mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* SMP race condition on startup with patch
@ 2002-04-30 11:55 D.J. Barrow
  2002-04-30 23:45 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: D.J. Barrow @ 2002-04-30 11:55 UTC (permalink / raw)
  To: Kernel Mailing List

Hi All,

I found a smp race condition on startup
of the 2.4.18 kernel when I put a printk
in schedule.


See the comment below in 
/init/main.c
/*
 * We need to finalize in a non-__init function or
else race conditions
 * between the root thread and the init thread may
cause start_kernel to
 * be reaped by free_initmem before the root thread
has proceeded to
 * cpu_idle.
 */
static void rest_init(void)

Note that init_idle the first thing  called from
cpu_idle.
& it is freed from 
free_initmem in the init function in main.c
which may be called before the cpu
gets into cpu_idle.


Here is the patch.

--- linux.orig/kernel/sched.c   Fri Dec 21 17:42:04
2001
+++ linux/kernel/sched.c        Tue Apr 30 12:22:02
2002
@@ -1299,7 +1299,7 @@

 extern unsigned long wait_init_idle;

-void __init init_idle(void)
+void init_idle(void)
 {
        struct schedule_data * sched_data;
        sched_data =
&aligned_data[smp_processor_id()].schedule_data;


=====
D.J. Barrow Linux kernel developer
eMail: dj_barrow@ariasoft.ie 
Home: +353-22-47196.
Work: +353-91-758353

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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

* Re: SMP race condition on startup with patch
  2002-04-30 11:55 SMP race condition on startup with patch D.J. Barrow
@ 2002-04-30 23:45 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2002-04-30 23:45 UTC (permalink / raw)
  To: D.J. Barrow; +Cc: Kernel Mailing List

> I found a smp race condition on startup
> of the 2.4.18 kernel when I put a printk
> in schedule.

Yep. Its already fixed in my tree if I remember rightly. 

BTW - a useful tip for checking your port is to memset the __init pages
to an illegal instruction value as you reclaim them.

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

end of thread, other threads:[~2002-04-30 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-30 11:55 SMP race condition on startup with patch D.J. Barrow
2002-04-30 23:45 ` Alan Cox

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®