From: Matthew Dobson <colpatch@us.ibm.com>
To: dino@in.ibm.com
Cc: Paul Jackson <pj@sgi.com>, Simon Derr <Simon.Derr@bull.net>,
Nick Piggin <nickpiggin@yahoo.com.au>,
lkml <linux-kernel@vger.kernel.org>,
lse-tech <lse-tech@lists.sourceforge.net>,
Dipankar Sarma <dipankar@in.ibm.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [RFC PATCH] Dynamic sched domains (v0.5)
Date: Tue, 03 May 2005 15:03:23 -0700 [thread overview]
Message-ID: <4277F52B.8040908@us.ibm.com> (raw)
In-Reply-To: <20050501190947.GA5204@in.ibm.com>
Dinakar Guniguntala wrote:
> Ok, Here is the minimal patchset that I had promised after the
> last discussion.
>
> What it does have
> o The current patch enhances the meaning of exclusive cpusets by
> attaching them (exclusive cpusets) to sched domains
> o It does _not_ require any additional cpumask_t variable. It
> just parses the cpus_allowed of the parent/sibling/children
> cpusets for manipulating sched domains
> o All existing operations on non-/exclusive cpusets are preserved as-is.
> o The sched code has been modified to bring it upto 2.6.12-rc2-mm3
>
> Usage
> o On setting the cpu_exclusive flag of a cpuset X, it creates two
> sched domains
> a. One, All cpus from X's parent cpuset that dont belong to any
> exclusive sibling cpuset of X
> b. Two, All cpus in X's cpus_allowed
> o On adding/deleting cpus to/from a exclusive cpuset X that has exclusive
> children, it creates two sched domains
> a. One, All cpus from X's parent cpuset that dont belong to any
> exclusive sibling cpuset of X
> b. Two, All cpus in X's cpus_allowed, after taking away any cpus that
> belong to exclusive child cpusets of X
> o On unsetting the cpu_exclusive flag of cpuset X or rmdir X, it creates a
> single sched domain, containing all cpus from X' parent cpuset that
> dont belong to any exclusive sibling of X and the cpus of X
> o It does _not_ modify the cpus_allowed variable of the parent as in the
> previous version. It relies on user space to move tasks to proper
> cpusets for complete isolation/exclusion
> o See function update_cpu_domains for more details
>
> What it does not have
> o It is still short on documentation
> o Does not have hotplug support as yet
> o Supports only x86 as of now
> o No thoughts on "memory domains" (Though I am not sure, who
> would use such a thing and what exactly are the requirements)
An interesting feature. I tried a while ago to get cpusets and
sched_domains to play nice (nicer?) and didn't have much luck. It seems
you're taking a better approach, with smaller patches. Good luck!
> diff -Naurp linux-2.6.12-rc2.orig/include/linux/init.h linux-2.6.12-rc2/include/linux/init.h
> --- linux-2.6.12-rc2.orig/include/linux/init.h 2005-04-04 22:07:52.000000000 +0530
> +++ linux-2.6.12-rc2/include/linux/init.h 2005-05-01 22:07:56.000000000 +0530
> @@ -217,7 +217,7 @@ void __init parse_early_param(void);
> #define __initdata_or_module __initdata
> #endif /*CONFIG_MODULES*/
>
> -#ifdef CONFIG_HOTPLUG
> +#if defined(CONFIG_HOTPLUG) || defined(CONFIG_CPUSETS)
> #define __devinit
> #define __devinitdata
> #define __devexit
This looks just plain wrong. Why do you need this? It doesn't seem that
arch_init_sched_domains() and/or update_sched_domains() are called from
anywhere that is cpuset related, so why the #ifdef CONFIG_CPUSETS?
> diff -Naurp linux-2.6.12-rc2.orig/kernel/sched.c linux-2.6.12-rc2/kernel/sched.c
> --- linux-2.6.12-rc2.orig/kernel/sched.c 2005-04-28 18:24:11.000000000 +0530
> +++ linux-2.6.12-rc2/kernel/sched.c 2005-05-01 22:06:55.000000000 +0530
> @@ -4526,7 +4526,7 @@ int __init migration_init(void)
> #endif
>
> #ifdef CONFIG_SMP
> -#define SCHED_DOMAIN_DEBUG
> +#undef SCHED_DOMAIN_DEBUG
> #ifdef SCHED_DOMAIN_DEBUG
> static void sched_domain_debug(struct sched_domain *sd, int cpu)
> {
Is this just to quiet boot for your testing? Is there are better reason
you're turning this off? It seems unrelated to the rest of your patch.
> ------------------------------------------------------------------------
>
> diff -Naurp linux-2.6.12-rc2.orig/kernel/cpuset.c linux-2.6.12-rc2/kernel/cpuset.c
> --- linux-2.6.12-rc2.orig/kernel/cpuset.c 2005-04-28 18:24:11.000000000 +0530
> +++ linux-2.6.12-rc2/kernel/cpuset.c 2005-05-01 22:15:06.000000000 +0530
> @@ -602,12 +602,48 @@ static int validate_change(const struct
> return 0;
> }
>
> +static void update_cpu_domains(struct cpuset *cur)
> +{
> + struct cpuset *c, *par = cur->parent;
> + cpumask_t span1, span2;
> +
> + if (par == NULL || cpus_empty(cur->cpus_allowed))
> + return;
> +
> + /* Get all non-exclusive cpus from parent domain */
> + span1 = par->cpus_allowed;
> + list_for_each_entry(c, &par->children, sibling) {
> + if (is_cpu_exclusive(c))
> + cpus_andnot(span1, span1, c->cpus_allowed);
> + }
> + if (is_removed(cur) || !is_cpu_exclusive(cur)) {
> + cpus_or(span1, span1, cur->cpus_allowed);
> + if (cpus_equal(span1, cur->cpus_allowed))
> + return;
> + span2 = CPU_MASK_NONE;
> + }
> + else {
> + if (cpus_empty(span1))
> + return;
> + span2 = cur->cpus_allowed;
> + /* If current cpuset has exclusive children, exclude from domain */
> + list_for_each_entry(c, &cur->children, sibling) {
> + if (is_cpu_exclusive(c))
> + cpus_andnot(span2, span2, c->cpus_allowed);
> + }
> + }
> +
> + lock_cpu_hotplug();
> + rebuild_sched_domains(span1, span2);
> + unlock_cpu_hotplug();
> +}
Nitpicky, but span1 and span2 could do with better names.
Otherwise, the patch looks good to me.
-Matt
next prev parent reply other threads:[~2005-05-03 22:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-01 19:09 [RFC PATCH] Dynamic sched domains (v0.5) Dinakar Guniguntala
2005-05-02 9:10 ` Nick Piggin
2005-05-02 17:17 ` Dinakar Guniguntala
2005-05-02 9:44 ` Nick Piggin
2005-05-02 17:16 ` Dinakar Guniguntala
2005-05-02 23:23 ` Nick Piggin
2005-05-03 14:58 ` Dinakar Guniguntala
2005-05-03 15:31 ` Paul Jackson
2005-05-02 18:01 ` Paul Jackson
2005-05-03 14:44 ` Dinakar Guniguntala
2005-05-03 15:21 ` Paul Jackson
2005-05-03 15:24 ` Paul Jackson
2005-05-03 22:03 ` Matthew Dobson [this message]
2005-05-04 0:08 ` Nick Piggin
2005-05-04 0:28 ` Matthew Dobson
2005-05-05 13:28 ` Dinakar Guniguntala
2005-05-05 13:26 ` Dinakar Guniguntala
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=4277F52B.8040908@us.ibm.com \
--to=colpatch@us.ibm.com \
--cc=Simon.Derr@bull.net \
--cc=akpm@osdl.org \
--cc=dino@in.ibm.com \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=nickpiggin@yahoo.com.au \
--cc=pj@sgi.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