1 #ifndef _VX_CVIRT_DEF_H
2 #define _VX_CVIRT_DEF_H
4 #include <linux/jiffies.h>
5 #include <linux/utsname.h>
6 #include <linux/spinlock.h>
7 #include <linux/wait.h>
8 #include <linux/time.h>
9 #include <asm/atomic.h>
12 struct _vx_usage_stat {
23 wait_queue_head_t log_wait;
24 spinlock_t logbuf_lock; /* lock for the log buffer */
26 unsigned long log_start; /* next char to be read by syslog() */
27 unsigned long con_start; /* next char to be sent to consoles */
28 unsigned long log_end; /* most-recently-written-char + 1 */
29 unsigned long logged_chars; /* #chars since last read+clear operation */
35 /* context sub struct */
38 // int max_threads; /* maximum allowed threads */
39 atomic_t nr_threads; /* number of current threads */
40 atomic_t nr_running; /* number of running threads */
41 atomic_t nr_uninterruptible; /* number of uninterruptible threads */
43 atomic_t nr_onhold; /* processes on hold */
44 uint32_t onhold_last; /* jiffies when put on hold */
46 struct timeval bias_tv; /* time offset to the host */
47 struct timespec bias_idle;
48 struct timespec bias_uptime; /* context creation point */
49 uint64_t bias_clock; /* offset in clock_t */
51 struct new_utsname utsname;
53 spinlock_t load_lock; /* lock for the load averages */
54 atomic_t load_updates; /* nr of load updates done so far */
55 uint32_t load_last; /* last time load was calculated */
56 uint32_t load[3]; /* load averages 1,5,15 */
58 atomic_t total_forks; /* number of forks so far */
60 struct _vx_syslog syslog;
64 struct _vx_usage_stat cpustat;
68 #ifdef CONFIG_VSERVER_DEBUG
70 static inline void __dump_vx_cvirt(struct _vx_cvirt *cvirt)
72 printk("\t_vx_cvirt:\n");
73 printk("\t threads: %4d, %4d, %4d, %4d\n",
74 atomic_read(&cvirt->nr_threads),
75 atomic_read(&cvirt->nr_running),
76 atomic_read(&cvirt->nr_uninterruptible),
77 atomic_read(&cvirt->nr_onhold));
79 printk("\t total_forks = %d\n", atomic_read(&cvirt->total_forks));
84 #endif /* _VX_CVIRT_DEF_H */