From: Max Krasnyansky <maxk@qualcomm.com>
To: Paul Jackson <pj@sgi.com>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, menage@google.com,
a.p.zijlstra@chello.nl, vegard.nossum@gmail.com,
lizf@cn.fujitsu.com
Subject: Re: [PATCH] cpuset: Rework sched domains and CPU hotplug handling (2.6.27-rc1)
Date: Wed, 06 Aug 2008 13:20:46 -0700 [thread overview]
Message-ID: <489A079E.5040903@qualcomm.com> (raw)
In-Reply-To: <20080806004629.d321f3b0.pj@sgi.com>
Paul Jackson wrote:
> How about this ... two routines quite identical and parallel,
> even in their names, except that one is async and the other not:
>
> ==================================================================
>
> /*
> * Rebuild scheduler domains, asynchronously in a separate thread.
> *
> * If the flag 'sched_load_balance' of any cpuset with non-empty
> * 'cpus' changes, or if the 'cpus' allowed changes in any cpuset
> * which has that flag enabled, or if any cpuset with a non-empty
> * 'cpus' is removed, then call this routine to rebuild the
> * scheduler's dynamic sched domains.
> *
> * The rebuild_sched_domains() and partition_sched_domains()
> * routines must nest cgroup_lock() inside get_online_cpus(),
> * but such cpuset changes as these must nest that locking the
> * other way, holding cgroup_lock() for much of the code.
> *
> * So in order to avoid an ABBA deadlock, the cpuset code handling
> * these user changes delegates the actual sched domain rebuilding
> * to a separate workqueue thread, which ends up processing the
> * above rebuild_sched_domains_thread() function.
> */
> static void async_rebuild_sched_domains(void)
> {
> queue_work(cpuset_wq, &rebuild_sched_domains_work);
> }
>
> /*
> * Accomplishes the same scheduler domain rebuild as the above
> * async_rebuild_sched_domains(), however it directly calls the
> * rebuild routine inline, rather than calling it via a separate
> * asynchronous work thread.
> *
> * This can only be called from code that is not holding
> * cgroup_mutex (not nested in a cgroup_lock() call.)
> */
> void inline_rebuild_sched_domains(void)
> {
> rebuild_sched_domains_thread(NULL);
> }
>
> ==================================================================
Sure. That looks fine. Although inline_ will probably be a bit confusing
since one may think that it has something to do with the C 'inline'.
I'd suggest either sync_rebuild_sched_domains() or simply
rebuild_sched_domains(). The later has the advantage that the patch will
not have to touch the scheduler code.
Let me know your preference and I'll respin the patch.
Max
next prev parent reply other threads:[~2008-08-06 20:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-01 22:59 [PATCH] cpuset: Rework sched domains and CPU hotplug handling (2.6.27-rc1) Max Krasnyansky
2008-08-02 11:39 ` Paul Jackson
2008-08-02 16:32 ` Max Krasnyansky
2008-08-03 3:51 ` Paul Jackson
2008-08-03 18:07 ` Max Krasnyansky
2008-08-04 6:00 ` Paul Jackson
2008-08-04 22:11 ` Max Krasnyansky
2008-08-05 3:56 ` Paul Jackson
2008-08-05 20:30 ` Max Krasnyansky
2008-08-05 23:05 ` Paul Jackson
2008-08-06 3:24 ` Max Krasnyansky
2008-08-06 3:29 ` Paul Jackson
2008-08-06 3:53 ` Max Krasnyansky
2008-08-06 4:28 ` Paul Jackson
2008-08-06 5:03 ` Max Krasnyansky
2008-08-06 5:46 ` Paul Jackson
2008-08-06 20:20 ` Max Krasnyansky [this message]
2008-08-06 20:29 ` Paul Jackson
2008-08-06 20:30 ` Paul Menage
2008-08-06 20:56 ` Paul Jackson
2008-08-06 20:36 ` Max Krasnyansky
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=489A079E.5040903@qualcomm.com \
--to=maxk@qualcomm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=mingo@elte.hu \
--cc=pj@sgi.com \
--cc=vegard.nossum@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox