From: Andrew Morton <akpm@linux-foundation.org>
To: Gregory Haskins <ghaskins@novell.com>
Cc: suresh.b.siddha@intel.com, ego@in.ibm.com, rjw@sisk.pl,
dmitry.adamushko@gmail.com, mingo@elte.hu, oleg@sign.ru,
yi.y.yang@intel.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de
Subject: Re: [PATCH v2] keep rd->online and cpu_online_map in sync
Date: Mon, 10 Mar 2008 16:36:13 -0700 [thread overview]
Message-ID: <20080310163613.65a7313c.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080310215813.10968.960.stgit@novell1.haskins.net>
On Mon, 10 Mar 2008 17:59:11 -0400 Gregory Haskins <ghaskins@novell.com> wrote:
> >>> On Mon, Mar 10, 2008 at 6:10 PM, in message
> <20080310221014.GB27329@linux-os.sc.intel.com>, Suresh Siddha
> <suresh.b.siddha@intel.com> wrote:
> > On Mon, Mar 10, 2008 at 04:00:28PM -0600, Gregory Haskins wrote:
> >> >>> On Mon, Mar 10, 2008 at 6:03 PM, in message
> > <200803102303.28660.rjw@sisk.pl>,
> >> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> >> > On Monday, 10 of March 2008, Suresh Siddha wrote:
> >> >> >
> >> >> > - case CPU_DOWN_PREPARE:
> >> >> > + case CPU_DYING:
> >> >>
> >> >> Don't we need to take care of CPU_DYING_FROZEN aswell?
> >> >
> >> > Well, I'd say we do.
> >>
> >> Should I add that to the patch as well then?
> >
> > Yes please.
>
> Here is v2 with the suggested improvement
>
> -Greg
>
> ------------------------
> keep rd->online and cpu_online_map in sync
>
> It is possible to allow the root-domain cache of online cpus to
> become out of sync with the global cpu_online_map. This is because we
> currently trigger removal of cpus too early in the notifier chain.
> Other DOWN_PREPARE handlers may in fact run and reconfigure the
> root-domain topology, thereby stomping on our own offline handling.
>
> The end result is that rd->online may become out of sync with
> cpu_online_map, which results in potential task misrouting.
>
> So change the offline handling to be more tightly coupled with the
> global offline process by triggering on CPU_DYING intead of
> CPU_DOWN_PREPARE.
>
> Signed-off-by: Gregory Haskins <ghaskins@novell.com>
> Cc: Gautham R Shenoy <ego@in.ibm.com>
> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> kernel/sched.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 52b9867..1cb53fb 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -5881,7 +5881,8 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
> spin_unlock_irq(&rq->lock);
> break;
>
> - case CPU_DOWN_PREPARE:
> + case CPU_DYING:
> + case CPU_DYING_FROZEN:
> /* Update our root-domain */
> rq = cpu_rq(cpu);
> spin_lock_irqsave(&rq->lock, flags);
Does this make
cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio.patch
(below) obsolete, or do we want both?
--- a/kernel/sched.c~cpu-hotplug-register-update_sched_domains-notifier-with-higher-prio
+++ a/kernel/sched.c
@@ -7096,8 +7096,16 @@ void __init sched_init_smp(void)
if (cpus_empty(non_isolated_cpus))
cpu_set(smp_processor_id(), non_isolated_cpus);
put_online_cpus();
- /* XXX: Theoretical race here - CPU may be hotplugged now */
- hotcpu_notifier(update_sched_domains, 0);
+ /*
+ * XXX: Theoretical race here - CPU may be hotplugged now
+ *
+ * We register the notifier with priority 11, which means that
+ * update_sched_domains() will be called just before migration_call().
+ *
+ * This is necessary to ensure that the rt wake up logic works fine
+ * and the rq->rd->online_map remains in sync with the cpu_online_map.
+ */
+ hotcpu_notifier(update_sched_domains, 11);
/* Move init over to a non-isolated CPU */
if (set_cpus_allowed(current, non_isolated_cpus) < 0)
_
next prev parent reply other threads:[~2008-03-10 23:37 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-02 18:42 [BUG 2.6.25-rc3] scheduler/hotplug: some processes are dealocked when cpu is set to offline Yi Yang
2008-03-03 11:54 ` Dmitry Adamushko
2008-03-03 11:56 ` Ingo Molnar
2008-03-03 12:02 ` Dmitry Adamushko
2008-03-03 14:53 ` Yi Yang
2008-03-03 17:37 ` Yi Yang
2008-03-03 15:31 ` Gautham R Shenoy
2008-03-03 14:45 ` Yi Yang
2008-03-04 5:26 ` Gautham R Shenoy
2008-03-04 9:09 ` Gautham R Shenoy
2008-03-03 21:56 ` Yi Yang
2008-03-04 15:01 ` Oleg Nesterov
2008-03-04 14:37 ` Yi Yang
2008-03-06 20:05 ` Yi Yang
2008-03-05 10:05 ` Gautham R Shenoy
2008-03-05 13:53 ` Oleg Nesterov
2008-03-06 11:15 ` Gautham R Shenoy
2008-03-06 12:22 ` Gautham R Shenoy
2008-03-06 13:44 ` Gautham R Shenoy
2008-03-07 2:54 ` Oleg Nesterov
2008-03-07 9:10 ` Gautham R Shenoy
2008-03-07 10:51 ` Gautham R Shenoy
2008-03-06 23:20 ` Yi Yang
2008-03-07 13:02 ` Dmitry Adamushko
2008-03-07 13:55 ` Gautham R Shenoy
2008-03-07 15:50 ` Gautham R Shenoy
2008-03-07 19:14 ` [BUG 2.6.25-rc3] scheduler/hotplug: some processes aredealocked " Suresh Siddha
2008-03-07 20:18 ` [BUG 2.6.25-rc3] scheduler/hotplug: some processes are dealocked " Andrew Morton
2008-03-07 21:36 ` Rafael J. Wysocki
2008-03-07 23:01 ` Suresh Siddha
2008-03-07 23:29 ` Andrew Morton
2008-03-07 23:43 ` Rafael J. Wysocki
2008-03-08 1:50 ` Suresh Siddha
2008-03-08 2:09 ` Andrew Morton
2008-03-08 5:10 ` [PATCH] adjust root-domain->online span in response to hotplug event Gregory Haskins
2008-03-08 8:41 ` Ingo Molnar
2008-03-08 17:50 ` [PATCH] adjust root-domain->online span in response to hotplugevent Gregory Haskins
2008-03-09 0:31 ` Dmitry Adamushko
2008-03-10 14:12 ` Gregory Haskins
2008-03-09 2:35 ` [PATCH] adjust root-domain->online span in response to hotplug event Suresh Siddha
2008-03-10 12:41 ` Gregory Haskins
2008-03-10 8:14 ` Gautham R Shenoy
2008-03-10 13:13 ` [PATCH] cpu-hotplug: Register update_sched_domains() notifier with higher prio Gautham R Shenoy
2008-03-10 22:25 ` Andrew Morton
2008-03-10 13:39 ` [PATCH] keep rd->online and cpu_online_map in sync Gregory Haskins
2008-03-10 14:21 ` Gautham R Shenoy
2008-03-10 18:12 ` Suresh Siddha
2008-03-10 22:03 ` Rafael J. Wysocki
2008-03-10 22:00 ` Gregory Haskins
2008-03-10 22:10 ` Suresh Siddha
2008-03-10 21:59 ` [PATCH v2] " Gregory Haskins
2008-03-10 23:36 ` Andrew Morton [this message]
2008-03-11 1:34 ` Suresh Siddha
2008-03-11 4:39 ` Gautham R Shenoy
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=20080310163613.65a7313c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dmitry.adamushko@gmail.com \
--cc=ego@in.ibm.com \
--cc=ghaskins@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@sign.ru \
--cc=rjw@sisk.pl \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=yi.y.yang@intel.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 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.