X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=linux-2.6-210-vserver-cpu-sched.patch;h=c2319da23438519fc2177a98d80d88e62efe911b;hb=7a0aece7f1eca54d524130d048a3348e98a849d1;hp=154d6eaf29da8aa1b2ec130217c574fa5b3261ac;hpb=1e496fdbc2589e47dc3039cb58550c58e9c9720a;p=linux-2.6.git diff --git a/linux-2.6-210-vserver-cpu-sched.patch b/linux-2.6-210-vserver-cpu-sched.patch index 154d6eaf2..c2319da23 100644 --- a/linux-2.6-210-vserver-cpu-sched.patch +++ b/linux-2.6-210-vserver-cpu-sched.patch @@ -1,7 +1,41 @@ +diff -Nurp linux-2.6.22-200/kernel/sched_hard.h linux-2.6.22-210/kernel/sched_hard.h +--- linux-2.6.22-200/kernel/sched_hard.h 2008-04-24 09:48:57.000000000 -0400 ++++ linux-2.6.22-210/kernel/sched_hard.h 2008-04-24 09:59:21.000000000 -0400 +@@ -179,8 +179,8 @@ void vx_try_unhold(struct rq *rq, int cp + int minskip = 0; + + /* nothing to do? what about pause? */ +- if (list_empty(&rq->hold_queue)) +- return; ++ //if (list_empty(&rq->hold_queue)) ++ // return; + + list_for_each_safe(l, n, &rq->hold_queue) { + int ret, delta_min[2]; diff -Nurp linux-2.6.22-200/kernel/vserver/sched.c linux-2.6.22-210/kernel/vserver/sched.c ---- linux-2.6.22-200/kernel/vserver/sched.c 2008-03-20 17:15:35.000000000 -0400 -+++ linux-2.6.22-210/kernel/vserver/sched.c 2008-03-31 17:55:55.000000000 -0400 -@@ -91,7 +91,7 @@ int vx_tokens_recalc(struct _vx_sched_pc +--- linux-2.6.22-200/kernel/vserver/sched.c 2008-04-24 09:48:57.000000000 -0400 ++++ linux-2.6.22-210/kernel/vserver/sched.c 2008-04-24 09:49:00.000000000 -0400 +@@ -18,7 +18,6 @@ + + #include + +- + #define vxd_check_range(val, min, max) do { \ + vxlprintk((val < min) || (val > max), \ + "check_range(%ld,%ld,%ld)", \ +@@ -78,6 +77,11 @@ int vx_tokens_recalc(struct _vx_sched_pc + /* how much time did pass? */ + delta = *norm_time - sched_pc->norm_time; + vxd_check_range(delta, 0, INT_MAX); ++ if (delta < 0) { ++ /* vserver is new or idle for a really long time */ ++ sched_pc->norm_time = *norm_time; ++ delta = 0; ++ } + + if (delta >= sched_pc->interval[0]) { + long tokens, integral; +@@ -91,7 +95,7 @@ int vx_tokens_recalc(struct _vx_sched_pc vxd_check_range(delta_min[0], 0, sched_pc->interval[0]); #endif /* advance time */ @@ -10,7 +44,21 @@ diff -Nurp linux-2.6.22-200/kernel/vserver/sched.c linux-2.6.22-210/kernel/vserv /* add tokens */ sched_pc->tokens += tokens; -@@ -161,10 +161,12 @@ on_hold: +@@ -106,7 +110,12 @@ int vx_tokens_recalc(struct _vx_sched_pc + /* how much was the idle skip? */ + delta = *idle_time - sched_pc->idle_time; + vxd_check_range(delta, 0, INT_MAX); +- ++ if (delta < 0) { ++ /* vserver is new or idle for a really long time */ ++ sched_pc->idle_time = *idle_time; ++ delta = 0; ++ } ++ + if (delta >= sched_pc->interval[1]) { + long tokens, integral; + +@@ -161,10 +170,12 @@ on_hold: /* next interval? */ if (!sched_pc->fill_rate[0]) delta_min[0] = HZ; @@ -27,16 +75,17 @@ diff -Nurp linux-2.6.22-200/kernel/vserver/sched.c linux-2.6.22-210/kernel/vserv delta_min[0] = sched_pc->interval[0] - delta_min[0]; vxd_check_range(delta_min[0], 0, INT_MAX); -@@ -175,10 +177,12 @@ on_hold: +@@ -175,10 +186,12 @@ on_hold: /* next interval? */ if (!sched_pc->fill_rate[1]) delta_min[1] = HZ; - else if (tokens > sched_pc->fill_rate[1]) -+ else if (tokens > sched_pc->fill_rate[1]) { - delta_min[1] += sched_pc->interval[1] * +- delta_min[1] += sched_pc->interval[1] * - tokens / sched_pc->fill_rate[1]; - else -+ tokens / sched_pc->fill_rate[1] - delta_min[1]; ++ else if (tokens > sched_pc->fill_rate[1]) { ++ delta_min[1] = sched_pc->interval[1] * ++ (tokens / sched_pc->fill_rate[1]) - delta_min[1]; + if (tokens % sched_pc->fill_rate[1]) + delta_min[1] += sched_pc->interval[1]; + } else