mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix bug in yield()
@ 2002-08-19  1:56 Paul Mackerras
  2002-08-19 11:43 ` Hiroshi Takekawa
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2002-08-19  1:56 UTC (permalink / raw)
  To: marcelo, linux-kernel

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.

diff -urN linux-2.4/kernel/sched.c pmac/kernel/sched.c
--- linux-2.4/kernel/sched.c	Wed Aug  7 18:10:01 2002
+++ pmac/kernel/sched.c	Mon Aug 19 10:39:39 2002
@@ -1081,6 +1081,7 @@
 {
 	set_current_state(TASK_RUNNING);
 	sys_sched_yield();
+	schedule();
 }
 
 void __cond_resched(void)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix bug in yield()
  2002-08-19  1:56 [PATCH] fix bug in yield() Paul Mackerras
@ 2002-08-19 11:43 ` Hiroshi Takekawa
  0 siblings, 0 replies; 2+ messages in thread
From: Hiroshi Takekawa @ 2002-08-19 11:43 UTC (permalink / raw)
  To: linux-kernel


Hi.

> 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 <sian@big.or.jp>


> 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.

> diff -urN linux-2.4/kernel/sched.c pmac/kernel/sched.c
> --- linux-2.4/kernel/sched.c	Wed Aug  7 18:10:01 2002
> +++ pmac/kernel/sched.c	Mon Aug 19 10:39:39 2002
> @@ -1081,6 +1081,7 @@
>  {
>  	set_current_state(TASK_RUNNING);
>  	sys_sched_yield();
> +	schedule();
>  }
 
>  void __cond_resched(void)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-19 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-19  1:56 [PATCH] fix bug in yield() Paul Mackerras
2002-08-19 11:43 ` Hiroshi Takekawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®