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 /* context sub struct */
21 atomic_t tokens; /* number of CPU tokens */
22 spinlock_t tokens_lock; /* lock for token bucket */
24 int fill_rate; /* Fill rate: add X tokens... */
25 int interval; /* Divisor: per Y jiffies */
26 int tokens_min; /* Limit: minimum for unhold */
27 int tokens_max; /* Limit: no more than N tokens */
28 uint32_t jiffies; /* last time accounted */
30 int priority_bias; /* bias offset for priority */
31 int vavavoom; /* last calculated vavavoom */
33 cpumask_t cpus_allowed; /* cpu mask for context */
35 struct _vx_ticks cpu[NR_CPUS];
39 #ifdef CONFIG_VSERVER_DEBUG
41 static inline void __dump_vx_sched(struct _vx_sched *sched)
43 printk("\t_vx_sched:\n");
44 printk("\t tokens: %4d, %4d, %4d, %4d, %4d\n",
45 atomic_read(&sched->tokens),
46 sched->fill_rate, sched->interval,
47 sched->tokens_min, sched->tokens_max);
48 printk("\t priority = %4d, %4d\n",
49 sched->priority_bias, sched->vavavoom);
54 #endif /* _VX_SCHED_DEF_H */