fix bug in yield()
PATCH 1/1 fix bug in yield()
This patch makes yield() actually call schedule.
Without this patch, 2.4.20-pre3 will hang on boot for me, looping in spawn_ksoftirqd waiting for ksoftirqd to start and calling yield(). ksoftirqd never gets to run, however, because yield never actually calls schedule. (Note that sys_sched_yield as a syscall is OK because the syscall exit path will check current->need_resched and call schedule).
Paul.
kernel/sched.c +1 -0
@@ -1081,6 +1081,7 @@ {set_current_state (TASK_RUNNING );sys_sched_yield (); +schedule (); }void __cond_resched (void )
Hi.
Quoted 1 line
This patch makes
yield()actually call schedule.
The trouble hanging after "Initializing RT netlink socket" which several report, just gone. And seems to work fine.
But I wonder whether doing schedule() here is good or not. In 2.5, schedule() is done in sys_sched_yield(). I don't know much about kernel things. So I just compared...
--
Hiroshi Takekawa <[email protected]>
Quoted 20 lines
Without this patch, 2.4.20-pre3 will hang on boot for me, looping in
spawn_ksoftirqdwaiting for ksoftirqd to start and callingyield(). ksoftirqd never gets to run, however, because yield never actually calls schedule. (Note thatsys_sched_yieldas a syscall is OK because the syscall exit path will checkcurrent->need_reschedand call schedule).Paul.
diff -urN
linux-2.4/kernel/sched.cpmac/kernel/sched.ckernel/sched.c +1
-0@@ -1081,6 +1081,7 @@ {set_current_state (TASK_RUNNING );sys_sched_yield (); +schedule (); }void __cond_resched (void )