From: Ingo Molnar <mingo@elte.hu>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: Problem with cpu_rest() change
Date: Tue, 25 Jan 2005 10:01:31 +0100 [thread overview]
Message-ID: <20050125090131.GA4986@elte.hu> (raw)
In-Reply-To: <1106534442.5272.10.camel@gaston>
* Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Hi Ingo !
>
> Could you explain me precisely what is the race you are fixing by
> adding local_irq_disable() to rest_init() ?
it can be bad for the idle task to hold the BKL and to have preemption
enabled - in such a situation the scheduler will get confused if an
interrupt triggers a forced preemption in that small window. But it's
not necessary to keep IRQs disabled after the BKL has been dropped. In
fact i think IRQ-disabling doesnt have to be done at all, the patch
below ought to solve this scenario equally well, and should solve the
PPC side-effects too.
Tested ontop of 2.6.11-rc2 on x86 PREEMPT+SMP and PREEMPT+!SMP (which
IIRC were the config variants that triggered the original problem), on
an SMP and on a UP system.
Ingo
Signed-off-by: Ingo Molnar <mingo@elte.hu>
--- linux/init/main.c.orig
+++ linux/init/main.c
@@ -373,14 +373,9 @@ 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();
+ preempt_enable_no_resched();
+ cpu_idle();
}
/* Check for early params. */
next prev parent reply other threads:[~2005-01-25 9:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-24 2:40 Problem with cpu_rest() change Benjamin Herrenschmidt
2005-01-25 9:01 ` Ingo Molnar [this message]
2005-01-25 23:49 ` Benjamin Herrenschmidt
2005-01-26 5:45 ` Kumar Gala
2005-01-26 13:44 ` Benjamin Herrenschmidt
2005-01-26 14:10 ` Kumar Gala
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=20050125090131.GA4986@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.