Bypass for the infinite loop in teh scheduler with interrupts off.
[linux-2.6.git] / linux-2.6-630-sched-fix.patch
1 --- linux-2.6.22-630/kernel/sched.c.orig        2008-04-23 17:09:21.000000000 -0400
2 +++ linux-2.6.22-630/kernel/sched.c     2008-04-23 17:10:23.000000000 -0400
3 @@ -3656,6 +3656,10 @@
4  /* CHOPSTIX */
5  #endif
6  
7 +/* Bypass the vx_unhold infinite loop */
8 +unsigned int merry;
9 +EXPORT_SYMBOL(merry);
10 +
11  asmlinkage void __sched schedule(void)
12  {
13         struct task_struct *prev, *next;
14 @@ -3740,14 +3744,22 @@
15  
16         cpu = smp_processor_id();
17         vx_set_rq_time(rq, jiffies);
18 +
19 +       merry=0;
20  try_unhold:
21         vx_try_unhold(rq, cpu);
22  pick_next:
23  
24         if (unlikely(!rq->nr_running)) {
25                 /* can we skip idle time? */
26 -               if (vx_try_skip(rq, cpu))
27 +               if (vx_try_skip(rq, cpu) && merry<10) {
28 +                       merry++;
29                         goto try_unhold;
30 +               }
31 +               else if (merry==10) {
32 +                       BUG();
33 +               }
34 +
35  
36                 idle_balance(cpu, rq);
37                 if (!rq->nr_running) {