From: Ingo Molnar <mingo@elte.hu>
To: Paul Fulghum <paulkf@microgate.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Gene Heskett <gene.heskett@verizon.net>,
Matt Heler <lkml@lpbproductions.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: 2.6.9-rc2-mm4
Date: Tue, 28 Sep 2004 01:01:19 +0200 [thread overview]
Message-ID: <20040927230119.GA31278@elte.hu> (raw)
In-Reply-To: <20040927204557.GA22542@elte.hu>
could you try the patch below ontop of -mm4 and try again the .config
that failed before? Does the bootup still hang?
The early bootup stage is pretty fragile because the idle thread is not
yet functioning as such and so we need preemption disabled. Whether the
bootup fails or not seems to depend on timing details so e.g. the
presence of SCHED_SMT makes it go away.
disabling preemption explicitly has another advantage: the atomicity
check in schedule() will catch early-bootup schedule() calls from now
on.
the patch also fixes another preempt-bkl buglet: interrupt-driven
forced-preemption didnt go through preempt_schedule() so it resulted in
auto-dropping of the BKL. Now we go through preempt_schedule() which
properly deals with the BKL.
Ingo
Signed-off-by: Ingo Molnar <mingo@elte.hu>
--- linux/init/main.c.orig
+++ linux/init/main.c
@@ -435,6 +435,12 @@ static void noinline rest_init(void)
{
kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
numa_default_policy();
+ /*
+ * Re-enable preemption but disable interrupts to make sure
+ * we dont get preempted until we schedule() in cpu_idle().
+ */
+ local_irq_disable();
+ preempt_enable_no_resched();
unlock_kernel();
cpu_idle();
}
@@ -501,6 +507,7 @@ asmlinkage void __init start_kernel(void
* time - but meanwhile we still have a functioning scheduler.
*/
sched_init();
+ preempt_disable();
build_all_zonelists();
page_alloc_init();
trap_init();
--- linux/arch/i386/kernel/entry.S.orig
+++ linux/arch/i386/kernel/entry.S
@@ -197,10 +197,8 @@ need_resched:
jz restore_all
testl $IF_MASK,EFLAGS(%esp) # interrupts off (exception path) ?
jz restore_all
- movl $PREEMPT_ACTIVE,TI_preempt_count(%ebp)
sti
- call schedule
- movl $0,TI_preempt_count(%ebp)
+ call preempt_schedule
cli
jmp need_resched
#endif
next prev parent reply other threads:[~2004-09-27 23:00 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-27 1:10 2.6.9-rc2-mm4 Andrew Morton
2004-09-27 4:53 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-27 5:13 ` 2.6.9-rc2-mm4 Andrew Morton
2004-09-27 6:31 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-27 7:02 ` 2.6.9-rc2-mm4 Gene Heskett
[not found] ` <200409270706.21661.lkml@lpbproductions.com>
2004-09-27 15:31 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-27 15:52 ` 2.6.9-rc2-mm4 Matt Heler
2004-09-27 16:06 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-27 16:27 ` 2.6.9-rc2-mm4 Geert Uytterhoeven
2004-09-27 16:40 ` 2.6.9-rc2-mm4 Matt Heler
2004-09-27 20:17 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-28 1:42 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-28 7:01 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-28 10:26 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-28 10:33 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-28 11:01 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-28 11:05 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-28 11:36 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-29 8:08 ` 2.6.9-rc2-mm4 Geert Uytterhoeven
2004-09-29 8:43 ` 2.6.9-rc2-mm4 Andreas Schwab
2004-09-30 16:49 ` 2.6.9-rc2-mm4 Bill Davidsen
2004-09-27 15:32 ` 2.6.9-rc2-mm4 Matt Heler
2004-09-27 20:19 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-27 20:34 ` 2.6.9-rc2-mm4 Paul Fulghum
2004-09-27 20:45 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-27 23:01 ` Ingo Molnar [this message]
2004-09-28 2:12 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-28 13:07 ` 2.6.9-rc2-mm4 Paul Fulghum
2004-09-27 21:14 ` 2.6.9-rc2-mm4 Ingo Molnar
2004-09-27 22:00 ` 2.6.9-rc2-mm4 Paul Fulghum
2004-09-27 21:52 ` 2.6.9-rc2-mm4 Felipe Alfaro Solana
2004-09-28 1:45 ` 2.6.9-rc2-mm4 Gene Heskett
2004-09-27 23:04 ` 2.6.9-rc2-mm4 J.A. Magallon
2004-09-29 10:43 ` 2.6.9-rc2-mm4 Borislav Petkov
2004-09-30 23:26 ` 2.6.9-rc2-mm4 J.A. Magallon
2004-10-01 0:05 ` 2.6.9-rc2-mm4 Andrew Morton
2004-10-01 0:17 ` 2.6.9-rc2-mm4 J.A. Magallon
2004-10-01 0:22 ` 2.6.9-rc2-mm4 J.A. Magallon
2004-10-01 0:31 ` 2.6.9-rc2-mm4 Randy.Dunlap
2004-10-01 5:51 ` 2.6.9-rc2-mm4 Dmitry Torokhov
2004-10-01 5:30 ` 2.6.9-rc2-mm4 Dmitry Torokhov
2004-10-01 18:01 ` 2.6.9-rc2-mm4 Greg KH
2004-10-01 18:26 ` 2.6.9-rc2-mm4 Vojtech Pavlik
2004-10-01 23:41 ` 2.6.9-rc2-mm4 Greg KH
2004-10-02 5:31 ` 2.6.9-rc2-mm4 Vojtech Pavlik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040927230119.GA31278@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=gene.heskett@verizon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@lpbproductions.com \
--cc=paulkf@microgate.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox