5 #warning config options missing
8 #include "vserver/sched.h"
11 #define VAVAVOOM_RATIO 50
13 #define MAX_PRIO_BIAS 20
14 #define MIN_PRIO_BIAS -20
17 static inline int vx_tokens_avail(struct vx_info *vxi)
19 return atomic_read(&vxi->sched.tokens);
22 static inline void vx_consume_token(struct vx_info *vxi)
24 atomic_dec(&vxi->sched.tokens);
27 static inline int vx_need_resched(struct task_struct *p)
29 #ifdef CONFIG_VSERVER_HARDCPU
30 struct vx_info *vxi = p->vx_info;
32 int slice = --p->time_slice;
34 #ifdef CONFIG_VSERVER_HARDCPU
38 if ((tokens = vx_tokens_avail(vxi)) > 0)
39 vx_consume_token(vxi);
40 /* for tokens > 0, one token was consumed */
49 static inline void vx_onhold_inc(struct vx_info *vxi)
51 int onhold = atomic_read(&vxi->cvirt.nr_onhold);
53 atomic_inc(&vxi->cvirt.nr_onhold);
55 vxi->cvirt.onhold_last = jiffies;
58 static inline void __vx_onhold_update(struct vx_info *vxi)
60 int cpu = smp_processor_id();
61 uint32_t now = jiffies;
62 uint32_t delta = now - vxi->cvirt.onhold_last;
64 vxi->cvirt.onhold_last = now;
65 vxi->sched.cpu[cpu].hold_ticks += delta;
68 static inline void vx_onhold_dec(struct vx_info *vxi)
70 if (atomic_dec_and_test(&vxi->cvirt.nr_onhold))
71 __vx_onhold_update(vxi);
75 #warning duplicate inclusion