diff -NurpP linux-2.6.16-vs2.1.1-rc15.2/kernel/sched.c linux-2.6.16-vs2.1.1-rc15.3/kernel/sched.c --- linux-2.6.16-vs2.1.1-rc15.2/kernel/sched.c 2006-04-05 02:24:55 +0200 +++ linux-2.6.16-vs2.1.1-rc15.3/kernel/sched.c 2006-04-12 01:02:26 +0200 @@ -674,7 +674,7 @@ static int effective_prio(task_t *p) prio = p->static_prio - bonus; /* adjust effective priority */ - prio += vx_adjust_prio(p, prio, MAX_USER_PRIO); + prio = vx_adjust_prio(p, prio, MAX_USER_PRIO); if (prio < MAX_RT_PRIO) prio = MAX_RT_PRIO; diff -NurpP linux-2.6.16-vs2.1.1-rc15.2/kernel/sched_hard.h linux-2.6.16-vs2.1.1-rc15.3/kernel/sched_hard.h --- linux-2.6.16-vs2.1.1-rc15.2/kernel/sched_hard.h 2006-04-05 04:13:02 +0200 +++ linux-2.6.16-vs2.1.1-rc15.3/kernel/sched_hard.h 2006-04-12 00:56:55 +0200 @@ -40,7 +40,9 @@ static inline int vx_try_skip(runqueue_t *rq, int cpu) { /* artificially advance time */ - if (rq->idle_skip && !list_empty(&rq->hold_queue)) { + if (rq->idle_skip > 0) { + vxdprintk(list_empty(&rq->hold_queue), + "hold queue empty on cpu %d", cpu); rq->idle_time += rq->idle_skip; vxm_idle_skip(rq, cpu); return 1; diff -NurpP linux-2.6.16-vs2.1.1-rc15.2/kernel/vserver/sched.c linux-2.6.16-vs2.1.1-rc15.3/kernel/vserver/sched.c --- linux-2.6.16-vs2.1.1-rc15.2/kernel/vserver/sched.c 2006-04-02 04:04:11 +0200 +++ linux-2.6.16-vs2.1.1-rc15.3/kernel/vserver/sched.c 2006-04-12 01:05:08 +0200 @@ -18,7 +18,12 @@ #include #include -#define vxd_check_range(val, min, max) +#define vxd_check_range(val, min, max) do { \ + vxlprintk((valmax), \ + "check_range(%ld,%ld,%ld)", \ + (long)val, (long)min, (long)max, \ + __FILE__, __LINE__); \ + } while (0) void vx_update_sched_param(struct _vx_sched *sched, @@ -153,27 +158,21 @@ on_hold: BUG_ON(tokens < 0); #ifdef CONFIG_VSERVER_HARDCPU - if (likely(tokens)) - delta_min[0] = sched_pc->interval[0] * - tokens / sched_pc->fill_rate[0] - - delta_min[0]; - else - delta_min[0] = sched_pc->interval[0] - - delta_min[0]; + /* next interval? */ + if (tokens > sched_pc->fill_rate[0]) + delta_min[0] += sched_pc->interval[0] * + tokens / sched_pc->fill_rate[0]; vxd_check_range(delta_min[0], 0, INT_MAX); #ifdef CONFIG_VSERVER_IDLETIME if (!(flags & VXSF_IDLE_TIME)) return -1; - if (likely(tokens)) - delta_min[1] = sched_pc->interval[1] * - tokens / sched_pc->fill_rate[1] - - delta_min[1]; - else - delta_min[1] = sched_pc->interval[1] - - delta_min[1]; - vxd_check_range(delta_min[0], 0, INT_MAX); + /* next interval? */ + if (tokens > sched_pc->fill_rate[1]) + delta_min[1] += sched_pc->interval[1] * + tokens / sched_pc->fill_rate[1]; + vxd_check_range(delta_min[1], 0, INT_MAX); return -2; #else @@ -225,7 +224,7 @@ int do_set_sched(struct vx_info *vxi, st if (set_mask & VXSM_PRIO_BIAS) vxi->sched.prio_bias = data->prio_bias; - vxi->sched.update_mask = set_mask; + vxi->sched.update_mask |= set_mask; #ifdef CONFIG_SMP rmb(); if (set_mask & VXSM_CPU_ID)