1 #ifndef _VX_SCHED_DEF_H
2 #define _VX_SCHED_DEF_H
4 #include <linux/spinlock.h>
5 #include <linux/jiffies.h>
6 #include <linux/cpumask.h>
7 #include <asm/atomic.h>
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 ? */
18 #ifdef CONFIG_VSERVER_ACB_SCHED
20 // Different scheduling classes
30 /* context sub struct */
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];
38 atomic_t tokens; /* number of CPU tokens */
39 spinlock_t tokens_lock; /* lock for token bucket */
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 */
47 int priority_bias; /* bias offset for priority */
48 int vavavoom; /* last calculated vavavoom */
50 cpumask_t cpus_allowed; /* cpu mask for context */
52 struct _vx_ticks cpu[NR_CPUS];
55 #endif /* _VX_SCHED_DEF_H */