1 diff -Nurp linux-2.6.22-200/kernel/sched_hard.h linux-2.6.22-210/kernel/sched_hard.h
2 --- linux-2.6.22-200/kernel/sched_hard.h 2008-04-24 09:48:57.000000000 -0400
3 +++ linux-2.6.22-210/kernel/sched_hard.h 2008-04-24 09:59:21.000000000 -0400
4 @@ -179,8 +179,8 @@ void vx_try_unhold(struct rq *rq, int cp
7 /* nothing to do? what about pause? */
8 - if (list_empty(&rq->hold_queue))
10 + //if (list_empty(&rq->hold_queue))
13 list_for_each_safe(l, n, &rq->hold_queue) {
14 int ret, delta_min[2];
15 diff -Nurp linux-2.6.22-200/kernel/vserver/sched.c linux-2.6.22-210/kernel/vserver/sched.c
16 --- linux-2.6.22-200/kernel/vserver/sched.c 2008-04-24 09:48:57.000000000 -0400
17 +++ linux-2.6.22-210/kernel/vserver/sched.c 2008-04-24 09:49:00.000000000 -0400
20 #include <asm/uaccess.h>
23 #define vxd_check_range(val, min, max) do { \
24 vxlprintk((val < min) || (val > max), \
25 "check_range(%ld,%ld,%ld)", \
26 @@ -78,6 +77,11 @@ int vx_tokens_recalc(struct _vx_sched_pc
27 /* how much time did pass? */
28 delta = *norm_time - sched_pc->norm_time;
29 vxd_check_range(delta, 0, INT_MAX);
31 + /* vserver is new or idle for a really long time */
32 + sched_pc->norm_time = *norm_time;
36 if (delta >= sched_pc->interval[0]) {
37 long tokens, integral;
38 @@ -91,7 +95,7 @@ int vx_tokens_recalc(struct _vx_sched_pc
39 vxd_check_range(delta_min[0], 0, sched_pc->interval[0]);
42 - sched_pc->norm_time += delta;
43 + sched_pc->norm_time += integral;
46 sched_pc->tokens += tokens;
47 @@ -106,7 +110,12 @@ int vx_tokens_recalc(struct _vx_sched_pc
48 /* how much was the idle skip? */
49 delta = *idle_time - sched_pc->idle_time;
50 vxd_check_range(delta, 0, INT_MAX);
53 + /* vserver is new or idle for a really long time */
54 + sched_pc->idle_time = *idle_time;
58 if (delta >= sched_pc->interval[1]) {
59 long tokens, integral;
61 @@ -161,10 +170,12 @@ on_hold:
63 if (!sched_pc->fill_rate[0])
65 - else if (tokens > sched_pc->fill_rate[0])
66 - delta_min[0] += sched_pc->interval[0] *
67 - tokens / sched_pc->fill_rate[0];
69 + else if (tokens > sched_pc->fill_rate[0]) {
70 + delta_min[0] = sched_pc->interval[0] *
71 + (tokens / sched_pc->fill_rate[0]) - delta_min[0];
72 + if (tokens % sched_pc->fill_rate[0])
73 + delta_min[0] += sched_pc->interval[0];
75 delta_min[0] = sched_pc->interval[0] - delta_min[0];
76 vxd_check_range(delta_min[0], 0, INT_MAX);
78 @@ -175,10 +186,12 @@ on_hold:
80 if (!sched_pc->fill_rate[1])
82 - else if (tokens > sched_pc->fill_rate[1])
83 - delta_min[1] += sched_pc->interval[1] *
84 - tokens / sched_pc->fill_rate[1];
86 + else if (tokens > sched_pc->fill_rate[1]) {
87 + delta_min[1] = sched_pc->interval[1] *
88 + (tokens / sched_pc->fill_rate[1]) - delta_min[1];
89 + if (tokens % sched_pc->fill_rate[1])
90 + delta_min[1] += sched_pc->interval[1];
92 delta_min[1] = sched_pc->interval[1] - delta_min[1];
93 vxd_check_range(delta_min[1], 0, INT_MAX);