From: Max Krasnyansky <maxk@qualcomm.com>
To: Gregory Haskins <ghaskins@novell.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
mingo@elte.hu, dmitry.adamushko@gmail.com,
torvalds@linux-foundation.org, pj@sgi.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpu hotplug, sched:Introduce cpu_active_map and redoscheddomainmanagment (take 2)
Date: Mon, 21 Jul 2008 22:10:01 -0700 [thread overview]
Message-ID: <48856BA9.6050609@qualcomm.com> (raw)
In-Reply-To: <488052D5.BA47.005A.0@novell.com>
Gregory Haskins wrote:
> Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>> I'm thinking doing it explicitly with the new cpu mask is clearer and
>> easier to understand than 'hiding' the variable in the root domain and
>> having to understand all the domain/root-domain stuff.
>>
>> I think this was Linus' main point. It should be easier to understand
>> this code.
>
> While I can appreciate this sentiment, note that we conceptually require
> IMO the notion that the root-domain masks present. E.g. we really dont
> want to migrate to just cpus_active_map, but rather
> rq->rd->span & cpus_active_map (otherwise we could route outside
> of a disjoint cpuset). And this is precisely what rq->rd->online is (a
> cached version of cpus_active_map & rq->rd->span).
>
> So while I can understand the motivation to keep things simple, note that
> I tried to design the root-domain stuff to be as simple as possible while
> still meeting the requirements for working within disjoint sets. I am
> open to other suggestions, but I see nothing particularly complex or
> wrong with whats going on there currently. Perhaps this very
> conversation is evidence that I needed to comment better ;)
>
>>
>> So, if there is functional overlap with the root domain stuff, it might
>> be good to remove that bit and use the cpu_active_map stuff for that
>> instead.
>
> I think we would be doing the code that does use it a disservice, per above.
Sorry for the delay. I finally had a chance to read through this thread again
and to look at the rq->rd->online logic.
One thing that came up during original discussion with Linus and Dmitry is
that cpuset can call partition_sched_domains() at random (user writes into
/dev/cpuset/...) but the scheduler used to rely on a certain sequence of the
domain creation/deletion during cpu hotplug. That's exactly what caused the
problem in the first place. My patch that fixed domain destruction by the
hotplug events changed the sequence the scheduler relied on and things broke.
Greg, correct me if I'm wrong but we seem to have exact same issue with the
rq->rq->online map. Lets take "cpu going down" for example. We're clearing
rq->rd->online bit on DYING event, but nothing AFAICS prevents another cpu
calling rebuild_sched_domains()->partition_sched_domains() in the middle of
the hotplug sequence.
partition_sched_domains() will happily reset rd->rq->online mask and things
will fail. I'm talking about this path
__build_sched_domains() -> cpu_attach_domain() -> rq_attach_root()
...
cpu_set(rq->cpu, rd->span);
if (cpu_isset(rq->cpu, cpu_online_map))
set_rq_online(rq);
...
--
btw Why didn't we convert sched*.c to use rq->rd->online when it was
introduced ? ie Instead of using cpu_online_map directly.
Max
next prev parent reply other threads:[~2008-07-22 5:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-15 11:43 [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redo sched domain managment (take 2) Max Krasnyansky
2008-07-15 11:49 ` Marcel Holtmann
2008-07-15 11:52 ` Peter Zijlstra
2008-07-15 11:57 ` Marcel Holtmann
2008-07-15 12:03 ` Peter Zijlstra
2008-07-15 15:24 ` Linus Torvalds
2008-07-15 12:45 ` Gregory Haskins
2008-07-15 15:22 ` Linus Torvalds
2008-07-16 8:57 ` Dmitry Adamushko
2008-07-16 20:29 ` Max Krasnyansky
2008-07-16 21:55 ` Dmitry Adamushko
2008-07-16 12:12 ` Gregory Haskins
2008-07-16 21:44 ` Max Krasnyansky
2008-07-17 2:51 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redosched " Gregory Haskins
2008-07-17 7:16 ` Max Krasnyansky
2008-07-17 11:57 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redoscheddomain " Gregory Haskins
2008-07-17 18:52 ` Max Krasnyansky
2008-07-17 19:46 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redoscheddomainmanagment " Gregory Haskins
2008-07-18 11:53 ` Peter Zijlstra
2008-07-18 12:22 ` [PATCH] cpu hotplug, sched:Introduce " Gregory Haskins
2008-07-22 5:10 ` Max Krasnyansky [this message]
2008-07-22 14:06 ` Gregory Haskins
2008-07-22 14:16 ` Peter Zijlstra
2008-07-22 14:17 ` Gregory Haskins
2008-07-22 14:26 ` Peter Zijlstra
2008-07-22 14:45 ` Gregory Haskins
2008-07-22 19:32 ` Max Krasnyansky
2008-08-11 13:11 ` Gregory Haskins
2008-08-11 21:57 ` Max Krasnyansky
2008-07-18 11:30 ` [PATCH] cpu hotplug, sched: Introduce cpu_active_map and redo sched domain managment " 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=48856BA9.6050609@qualcomm.com \
--to=maxk@qualcomm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=dmitry.adamushko@gmail.com \
--cc=ghaskins@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pj@sgi.com \
--cc=torvalds@linux-foundation.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