This commit was manufactured by cvs2svn to create branch
[linux-2.6.git] / include / linux / vserver / sched_def.h
1 #ifndef _VX_SCHED_DEF_H
2 #define _VX_SCHED_DEF_H
3
4 #include <linux/spinlock.h>
5 #include <linux/jiffies.h>
6 #include <linux/cpumask.h>
7 #include <asm/atomic.h>
8 #include <asm/param.h>
9
10
11 struct _vx_ticks {
12         uint64_t user_ticks;            /* token tick events */
13         uint64_t sys_ticks;             /* token tick events */
14         uint64_t hold_ticks;            /* token ticks paused */
15         uint64_t unused[5];             /* cacheline ? */
16 };
17
18 #ifdef CONFIG_VSERVER_ACB_SCHED
19 enum {
20 // Different scheduling classes
21     SCH_GUARANTEE = 0,
22     SCH_BEST_EFFORT = 1,
23     SCH_NUM_CLASSES = 2,
24 // States
25     SCH_UNINITIALIZED,
26     SCH_INITIALIZED,
27 };
28 #endif
29
30 /* context sub struct */
31
32 struct _vx_sched {
33 #ifdef CONFIG_VSERVER_ACB_SCHED
34         uint64_t ticks[SCH_NUM_CLASSES];
35         uint64_t last_ticks[SCH_NUM_CLASSES];
36         int      state[SCH_NUM_CLASSES];
37 #endif
38         atomic_t tokens;                /* number of CPU tokens */
39         spinlock_t tokens_lock;         /* lock for token bucket */
40
41         int fill_rate;                  /* Fill rate: add X tokens... */
42         int interval;                   /* Divisor:   per Y jiffies   */
43         int tokens_min;                 /* Limit:     minimum for unhold */
44         int tokens_max;                 /* Limit:     no more than N tokens */
45         uint32_t jiffies;               /* last time accounted */
46
47         int priority_bias;              /* bias offset for priority */
48         int vavavoom;                   /* last calculated vavavoom */
49
50         cpumask_t cpus_allowed;         /* cpu mask for context */
51
52         struct _vx_ticks cpu[NR_CPUS];
53 };
54
55 #endif  /* _VX_SCHED_DEF_H */