Copied from trunk
authorAndy Bavier <acb@cs.princeton.edu>
Tue, 25 Mar 2008 16:57:47 +0000 (16:57 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Tue, 25 Mar 2008 16:57:47 +0000 (16:57 +0000)
linux-2.6-210-vserver-cpu-sched.patch [new file with mode: 0644]

diff --git a/linux-2.6-210-vserver-cpu-sched.patch b/linux-2.6-210-vserver-cpu-sched.patch
new file mode 100644 (file)
index 0000000..fac58b7
--- /dev/null
@@ -0,0 +1,28 @@
+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-02-01 10:44:49.000000000 -0500
++++ linux-2.6.22-210/kernel/vserver/sched.c    2008-02-01 11:14:33.000000000 -0500
+@@ -89,6 +89,7 @@ int vx_tokens_recalc(struct _vx_sched_pc
+ #ifdef        CONFIG_VSERVER_HARDCPU
+               delta_min[0] = delta - integral;
+               vxd_check_range(delta_min[0], 0, sched_pc->interval[0]);
++              delta = integral;
+ #endif
+               /* advance time */
+               sched_pc->norm_time += delta;
+@@ -161,10 +162,12 @@ on_hold:
+       /* next interval? */
+       if (!sched_pc->fill_rate[0])
+               delta_min[0] = HZ;
+-      else if (tokens > sched_pc->fill_rate[0])
+-              delta_min[0] += sched_pc->interval[0] *
+-                      tokens / sched_pc->fill_rate[0];
+-      else
++      else if (tokens > sched_pc->fill_rate[0]) { 
++              delta_min[0] = sched_pc->interval[0] * 
++                      (tokens / sched_pc->fill_rate[0]) - delta_min[0]; 
++              if (tokens % sched_pc->fill_rate[0]) 
++                      delta_min[0] += sched_pc->interval[0]; 
++      } else 
+               delta_min[0] = sched_pc->interval[0] - delta_min[0];
+       vxd_check_range(delta_min[0], 0, INT_MAX);