Merge to Fedora kernel-2.6.18-1.2255_FC5-vs2.0.2.2-rc9 patched with stable patch...
[linux-2.6.git] / include / linux / vserver / cvirt_def.h
1 #ifndef _VX_CVIRT_DEF_H
2 #define _VX_CVIRT_DEF_H
3
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>
10
11 #include "cacct.h"
12
13
14 struct _vx_usage_stat {
15         uint64_t user;
16         uint64_t nice;
17         uint64_t system;
18         uint64_t softirq;
19         uint64_t irq;
20         uint64_t idle;
21         uint64_t iowait;
22 };
23
24 struct _vx_syslog {
25         wait_queue_head_t log_wait;
26         spinlock_t logbuf_lock;         /* lock for the log buffer */
27
28         unsigned long log_start;        /* next char to be read by syslog() */
29         unsigned long con_start;        /* next char to be sent to consoles */
30         unsigned long log_end;  /* most-recently-written-char + 1 */
31         unsigned long logged_chars;     /* #chars since last read+clear operation */
32
33         char log_buf[1024];
34 };
35
36
37 /* context sub struct */
38
39 struct _vx_cvirt {
40         int max_threads;                /* maximum allowed threads */
41         atomic_t nr_threads;            /* number of current threads */
42         atomic_t nr_running;            /* number of running threads */
43         atomic_t nr_uninterruptible;    /* number of uninterruptible threads */
44
45         atomic_t nr_onhold;             /* processes on hold */
46         uint32_t onhold_last;           /* jiffies when put on hold */
47
48         struct timespec bias_idle;
49         struct timespec bias_uptime;    /* context creation point */
50         uint64_t bias_clock;            /* offset in clock_t */
51
52         struct new_utsname utsname;
53
54         spinlock_t load_lock;           /* lock for the load averages */
55         atomic_t load_updates;          /* nr of load updates done so far */
56         uint32_t load_last;             /* last time load was cacled */
57         uint32_t load[3];               /* load averages 1,5,15 */
58
59         atomic_t total_forks;           /* number of forks so far */
60
61         struct _vx_syslog syslog;
62 };
63
64 struct _vx_sock_acc {
65         atomic_t count;
66         atomic_t total;
67 };
68
69 /* context sub struct */
70
71 struct _vx_cacct {
72         unsigned long total_forks;
73
74         struct _vx_sock_acc sock[VXA_SOCK_SIZE][3];
75 };
76
77 #endif  /* _VX_CVIRT_DEF_H */