[PATCH]: minor bug at schedule()

From: Juan J. Quintela (quintela@fi.udc.es)
Date: Thu Sep 07 2000 - 17:57:08 EST


Hi

        I have found that we run botton handlers (in schedule()) when
we are in the middle of an interrupt. I think that is illegal, and
moved the test to the beginning of the function. In the case that the
running of the bottom handlers before the test is on purpose, could
somebody put a comment there, please.

I also remove an unneeded return.

Later, Juan.

diff -urN --exclude-from=/home/lfcia/quintela/work/kernel/exclude base/kernel/sched.c working/kernel/sched.c
--- base/kernel/sched.c Wed Sep 6 00:37:32 2000
+++ working/kernel/sched.c Fri Sep 8 00:43:11 2000
@@ -504,6 +504,9 @@
         struct list_head *tmp;
         int this_cpu, c;
 
+ if (in_interrupt())
+ goto scheduling_in_interrupt;
+
         if (!current->active_mm) BUG();
         if (tq_scheduler)
                 goto handle_tq_scheduler;
@@ -512,9 +515,6 @@
         prev = current;
         this_cpu = prev->processor;
 
- if (in_interrupt())
- goto scheduling_in_interrupt;
-
         release_kernel_lock(prev, this_cpu);
 
         /* Do "administrative" work here while we don't hold any locks */
@@ -696,7 +696,6 @@
 scheduling_in_interrupt:
         printk("Scheduling in interrupt\n");
         BUG();
- return;
 }
 
 static inline void __wake_up_common (wait_queue_head_t *q, unsigned int mode,

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:31 EST