/* sched vserver commands */
-#define VCMD_set_sched_v1 VC_CMD(SYSTEST, 1, 1)
-
-struct vcmd_set_sched_v1 {
- int32_t fill_rate;
- int32_t period;
- int32_t fill_level;
- int32_t bucket_size;
-};
-
#define VCMD_set_sched VC_CMD(SCHED, 1, 2)
struct vcmd_set_sched_v2 {
atomic_dec(&vxi->sched.tokens);
}
-static inline int vx_need_resched(struct task_struct *p, struct vx_info *vxi)
+static inline int vx_need_resched(struct task_struct *p)
{
- p->time_slice--;
+#ifdef CONFIG_VSERVER_HARDCPU
+ struct vx_info *vxi = p->vx_info;
+
if (vxi) {
int tokens;
+
+ p->time_slice--;
+ if (atomic_read(&vxi->vx_refcount) < 1)
+ printk("need_resched: p=%p, s=%ld, ref=%d, id=%d/%d\n",
+ p, p->state, atomic_read(&vxi->vx_refcount),
+ vxi->vx_id, p->xid);
if ((tokens = vx_tokens_avail(vxi)) > 0)
vx_consume_token(vxi);
-
return ((p->time_slice == 0) || (tokens < 1));
- } else
- return (p->time_slice == 0);
+ }
+#endif
+ p->time_slice--;
+ return (p->time_slice == 0);
}