public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* init_idle reaped before final call
@ 2002-03-05 19:56 Kip Walker
  2002-03-05 21:57 ` Martin J. Bligh
  0 siblings, 1 reply; 6+ messages in thread
From: Kip Walker @ 2002-03-05 19:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mips, kwalker


I'm working with a (approximately) 2.4.17 kernel from the mips-linux
tree (oss.sgi.com).

I'd like to propose removing the "__init" designation from init_idle in
kernel/sched.c, since this is called from rest_init via cpu_idle. 
Notice that rest_init isn't in an init section, and explicitly mentions
that it's avoiding a race with free_initmem.  In my kernel (an SMP
kernel running on a system with only 1 available CPU), cpu_idle isn't
getting called until after free_initmem().

My CPU is MIPS, but it looks like x86 could experience the same problem.

Kip

Index: kernel/sched.c
===================================================================
RCS file:
/projects/bbp/cvsroot/systemsw/linux/src/kernel/kernel/sched.c,v
retrieving revision 1.10
diff -u -r1.10 sched.c
--- kernel/sched.c      2002/01/15 04:13:43     1.10
+++ kernel/sched.c      2002/03/05 19:40:14
@@ -1304,7 +1304,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;


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: init_idle reaped before final call
@ 2002-03-05 22:06 Thomas Hood
  2002-03-06  3:57 ` Keith Owens
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Hood @ 2002-03-05 22:06 UTC (permalink / raw)
  To: linux-kernel

I think you're right.  To prevent the mistake from
happening again, I'd suggest you add a comment to your
patch for init_idle(), explaining that it can't be __init 
because it is called by cpu_idle, which is called
by rest_init(), which ...

I wonder if an automated __init consistency checker 
would be helpful.

--
Thomas Hood



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

end of thread, other threads:[~2002-03-06  3:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-05 19:56 init_idle reaped before final call Kip Walker
2002-03-05 21:57 ` Martin J. Bligh
2002-03-05 22:15   ` Kip Walker
2002-03-05 23:33     ` Justin Carlson
  -- strict thread matches above, loose matches on Subject: below --
2002-03-05 22:06 Thomas Hood
2002-03-06  3:57 ` Keith Owens

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