This commit was manufactured by cvs2svn to create branch 'vserver'.
[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/time.h>
8 #include <asm/atomic.h>
9
10
11 struct _vx_usage_stat {
12         uint64_t user;
13         uint64_t nice;
14         uint64_t system;
15         uint64_t softirq;
16         uint64_t irq;
17         uint64_t idle;
18         uint64_t iowait;
19 };
20
21 /* context sub struct */
22
23 struct _vx_cvirt {
24         int max_threads;                /* maximum allowed threads */
25         atomic_t nr_threads;            /* number of current threads */
26         atomic_t nr_running;            /* number of running threads */
27         atomic_t nr_uninterruptible;    /* number of uninterruptible threads */
28
29         atomic_t nr_onhold;             /* processes on hold */
30         uint32_t onhold_last;           /* jiffies when put on hold */
31
32         struct timespec bias_idle;
33         struct timespec bias_uptime;    /* context creation point */
34         uint64_t bias_clock;            /* offset in clock_t */
35
36         struct new_utsname utsname;
37
38         spinlock_t load_lock;           /* lock for the load averages */
39         atomic_t load_updates;          /* nr of load updates done so far */
40         uint32_t load_last;             /* last time load was cacled */
41         uint32_t load[3];               /* load averages 1,5,15 */
42
43         struct _vx_usage_stat cpustat[NR_CPUS];
44 };
45
46 struct _vx_sock_acc {
47         atomic_t count;
48         atomic_t total;
49 };
50
51 /* context sub struct */
52
53 struct _vx_cacct {
54         unsigned long total_forks;
55
56         struct _vx_sock_acc sock[5][3];
57 };
58
59 #endif  /* _VX_CVIRT_DEF_H */