From: Ingo Molnar <mingo@elte.hu>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] fix init_idle() locking problem
Date: Tue, 11 May 2004 11:39:13 +0200 [thread overview]
Message-ID: <20040511093913.GA17185@elte.hu> (raw)
In-Reply-To: <200405101032.18508.bjorn.helgaas@hp.com>
* Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> When starting up secondary CPUs, most architectures do something like
> this:
>
> do_boot_cpu(int cpu)
> {
> idle = fork_by_hand();
> wake_up_forked_process(idle);
> init_idle(idle, cpu);
>
> init_idle() removes "idle" from its runqueue, but there's a window
> between looking up the runqueue and locking it, where another CPU can
> move "idle" to a different runqueue, i.e., via load_balance().
the sched-domains patches that are now in BK solve this problem in a
cleaner way: the rule is that no cross-CPU balancing is allowed until
all CPUs have booted up.
This is enforced by having a boot-time sched-domains tree (initialized
very early on, prior setting up any IRQ sources, in sched_init()), that
isolates each and every CPU from each other - so load_balance() cannot
balance away an idle task. Once all CPUs have booted up the arch can
'cross-connect' all the CPUs and scheduling will begin for real.
this two-phase approach enabled us to reduce alot of the early-boot
scheduling nastiness.
[ btw., your patch does not seem to be correct anyway - if an online CPU
'steals' the new idle task then it will also most likely run it - and
that is disastrous for any CLONE_IDLETASK task. (e.g. on x86 the EIP has
random content, most likely crashing that CPU.) ]
the hotplug CPU code of course must be (and is) extra careful about
installing the new idle task.
Ingo
next prev parent reply other threads:[~2004-05-11 9:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-10 16:32 Bjorn Helgaas
2004-05-11 9:39 ` Ingo Molnar [this message]
2004-05-11 16:13 ` Bjorn Helgaas
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=20040511093913.GA17185@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=bjorn.helgaas@hp.com \
--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 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®