From: Olaf Hering <olh@suse.de>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] idle thread preemption fix
Date: Fri, 28 Jan 2005 23:43:17 +0100 [thread overview]
Message-ID: <20050128224317.GA6197@suse.de> (raw)
In-Reply-To: <200501082318.j08NI6Kg027877@hera.kernel.org>
On Sat, Jan 08, Linux Kernel Mailing List wrote:
> ChangeSet 1.2316, 2005/01/08 13:53:41-08:00, mingo@elte.hu
>
> [PATCH] idle thread preemption fix
>
> 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.
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
> diff -Nru a/init/main.c b/init/main.c
> --- a/init/main.c 2005-01-08 15:18:18 -08:00
> +++ b/init/main.c 2005-01-08 15:18:18 -08:00
> @@ -373,6 +373,12 @@
> {
> 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();
> }
Whats the purpose of local_irq_disable() here? Locks up my toys in
atkbd_init or IP hash foo functions.
next parent reply other threads:[~2005-01-28 22:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200501082318.j08NI6Kg027877@hera.kernel.org>
2005-01-28 22:43 ` Olaf Hering [this message]
2005-01-28 23:28 ` [PATCH] idle thread preemption fix Ingo Molnar
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=20050128224317.GA6197@suse.de \
--to=olh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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