For qemu testing
[linux-2.6.git] / linux-2.6-630-sched-fix.patch
index 150a12c..9b56c28 100644 (file)
@@ -1,37 +1,45 @@
---- linux-2.6.22-630/kernel/sched.c.orig       2008-04-23 17:09:21.000000000 -0400
-+++ linux-2.6.22-630/kernel/sched.c    2008-04-23 17:10:23.000000000 -0400
-@@ -3656,6 +3656,10 @@
- /* CHOPSTIX */
- #endif
+diff -NurpP --exclude '*.orig' --exclude '*.rej' linux-2.6.27.10-vs2.3.x-P/fs/proc/proc_misc.c linux-2.6.27.10-vs2.3.x-P630/fs/proc/proc_misc.c
+--- linux-2.6.27.10-vs2.3.x-P/fs/proc/proc_misc.c      2008-10-13 14:54:20.000000000 +0200
++++ linux-2.6.27.10-vs2.3.x-P630/fs/proc/proc_misc.c   2009-01-12 01:18:23.000000000 +0100
+@@ -877,6 +877,34 @@ static struct file_operations proc_kpage
+ };
+ #endif /* CONFIG_PROC_PAGE_MONITOR */
  
-+/* Bypass the vx_unhold infinite loop */
-+unsigned int merry;
-+EXPORT_SYMBOL(merry);
++extern char debug_630_dumped[4087];
++static int show_debug_630(struct seq_file *p, void *v)
++{
++      seq_printf(p, "%s\n", debug_630_dumped);
++      return 0;
++}
 +
- asmlinkage void __sched schedule(void)
- {
-       struct task_struct *prev, *next;
-@@ -3740,14 +3744,22 @@
-       cpu = smp_processor_id();
-       vx_set_rq_time(rq, jiffies);
++static int debug_630_open(struct inode *inode, struct file *filp)
++{
++      int res;
++      struct seq_file *m;
 +
-+      merry=0;
- try_unhold:
-       vx_try_unhold(rq, cpu);
- pick_next:
-       if (unlikely(!rq->nr_running)) {
-               /* can we skip idle time? */
--              if (vx_try_skip(rq, cpu))
-+              if (vx_try_skip(rq, cpu) && merry<10) {
-+                      merry++;
-                       goto try_unhold;
-+              }
-+              else if (merry==10) {
-+                      BUG();
-+              }
++      res = single_open(filp, show_debug_630, NULL);
++      if (!res) {
++              m = filp->private_data;
++              m->buf = kmalloc(4096, GFP_KERNEL);
++              m->size = 4096;
++      }
++      return res;
++}
 +
++static const struct file_operations proc_debug_630_operations = {
++      .open = debug_630_open,
++      .read = seq_read,
++      .llseek = seq_lseek,
++      .release = single_release,
++};
++
+ struct proc_dir_entry *proc_root_kcore;
  
-               idle_balance(cpu, rq);
-               if (!rq->nr_running) {
+ void __init proc_misc_init(void)
+@@ -955,4 +983,6 @@ void __init proc_misc_init(void)
+ #ifdef CONFIG_MAGIC_SYSRQ
+       proc_create("sysrq-trigger", S_IWUSR, NULL, &proc_sysrq_trigger_operations);
+ #endif
++
++      create_seq_entry("debug_630", 0, &proc_debug_630_operations);
+ }