From: Randy Dunlap <randy.dunlap@oracle.com>
To: Paul Jackson <pj@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
nickpiggin@yahoo.com.au, Paul Menage <menage@google.com>,
linux-kernel@vger.kernel.org,
Dinakar Guniguntala <dino@in.ibm.com>,
cpw@sgi.com, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] cpuset and sched domains: sched_load_balance flag
Date: Tue, 2 Oct 2007 13:22:14 -0700 [thread overview]
Message-ID: <20071002132214.330ae2ca.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20070930104403.24828.48263.sendpatchset@jackhammer.engr.sgi.com>
On Sun, 30 Sep 2007 03:44:03 -0700 Paul Jackson wrote:
> From: Paul Jackson <pj@sgi.com>
>
...
>
> Acked-by: Paul Jackson <pj@sgi.com>
Are there some attributions missing, else S-O-B ?
> ---
>
> Andrew - this patch goes right after your *-mm patch:
> task-containers-enable-containers-by-default-in-some-configs.patch
> and before "add-containerstats-v3.patch"
>
> Documentation/cpusets.txt | 141 +++++++++++++++++++++++++
> include/linux/sched.h | 2
> kernel/cpuset.c | 254 +++++++++++++++++++++++++++++++++++++++++++++-
> kernel/sched.c | 72 ++++++++++---
> 4 files changed, 450 insertions(+), 19 deletions(-)
> --- 2.6.23-rc8-mm1.orig/kernel/cpuset.c 2007-09-29 23:56:40.987962675 -0700
> +++ 2.6.23-rc8-mm1/kernel/cpuset.c 2007-09-29 23:57:51.148979999 -0700
> /*
> + * Helper routine for rebuild_sched_domains().
> + * Do cpusets a, b have overlapping cpus_allowed masks?
> + */
> +
> +static int cpusets_overlap(struct cpuset *a, struct cpuset *b)
inline ?
> +{
> + return cpus_intersects(a->cpus_allowed, b->cpus_allowed);
> +}
> +
...
> +
> +static void rebuild_sched_domains(void)
> +{
> + struct kfifo *q; /* queue of cpusets to be scanned */
> + struct cpuset *cp; /* scans q */
> + struct cpuset **csa; /* array of all cpuset ptrs */
> + int csn; /* how many cpuset ptrs in csa so far */
> + int i, j, k; /* indices for partition finding loops */
> + cpumask_t *doms; /* resulting partition; i.e. sched domains */
> + int ndoms; /* number of sched domains in result */
> + int nslot; /* next empty doms[] cpumask_t slot */
> +
> + q = NULL; csa = NULL; doms = NULL;
That's not kernel style. Use either (Andrew would say the second one):
q = csa = doms = NULL;
or
q = NULL;
csa = NULL;
doms = NULL;
> +
> + /* Special case for the 99% of systems with one, full, sched domain */
> + if (is_sched_load_balance(&top_cpuset)) {
> + ndoms = 1;
> + doms = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
> + *doms = top_cpuset.cpus_allowed;
> + goto rebuild;
> + }
> +
...
> +
> +rebuild:
> + /* Have scheduler rebuild sched domains */
> + lock_cpu_hotplug();
> + partition_sched_domains(ndoms, doms);
> + unlock_cpu_hotplug();
> +
> +done:
> + if (q && !IS_ERR(q))
> + kfree(q);
> + if (csa)
Don't need the conditional: kfree(NULL) is OK.
> + kfree(csa);
> + /* Don't kfree(doms) -- partition_sched_domains() does that. */
> +}
> +
> +/*
> * Call with manage_mutex held. May take callback_mutex during call.
> */
---
~Randy
next prev parent reply other threads:[~2007-10-02 20:23 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-30 10:44 [PATCH] cpuset and sched domains: sched_load_balance flag Paul Jackson
2007-09-29 19:21 ` Nick Piggin
2007-09-30 18:07 ` Paul Jackson
2007-09-30 3:34 ` Nick Piggin
2007-10-01 3:42 ` Paul Jackson
2007-10-02 13:05 ` Nick Piggin
2007-10-03 6:58 ` Paul Jackson
2007-10-02 16:09 ` Nick Piggin
2007-10-03 9:55 ` Paul Jackson
2007-10-02 17:56 ` Nick Piggin
2007-10-03 11:38 ` Paul Jackson
2007-10-02 19:25 ` Nick Piggin
2007-10-03 12:14 ` Paul Jackson
2007-10-02 19:53 ` Nick Piggin
2007-10-03 12:41 ` Paul Jackson
2007-10-02 20:30 ` Nick Piggin
2007-10-03 17:46 ` Paul Jackson
2007-10-03 12:17 ` Paul Jackson
2007-10-02 20:31 ` Nick Piggin
2007-10-03 17:44 ` Paul Jackson
2007-10-01 18:15 ` Paul Jackson
2007-10-02 13:35 ` Nick Piggin
2007-10-03 6:22 ` [patch] sched: fix sched-domains partitioning by cpusets Ingo Molnar
2007-10-03 6:56 ` Paul Jackson
2007-10-02 15:46 ` Nick Piggin
2007-10-03 9:21 ` Paul Jackson
2007-10-02 17:23 ` Nick Piggin
2007-10-03 10:08 ` Paul Jackson
2007-10-03 9:35 ` Ingo Molnar
2007-10-03 9:39 ` Paul Jackson
2007-10-02 17:29 ` Nick Piggin
2007-10-03 7:20 ` Ingo Molnar
2007-10-03 7:25 ` [PATCH] cpuset and sched domains: sched_load_balance flag Paul Jackson
2007-10-02 16:14 ` Nick Piggin
2007-09-30 10:44 ` [PATCH] cpuset decrustify update and validate masks Paul Jackson
2007-09-30 17:33 ` [PATCH] cpuset and sched domains: sched_load_balance flag Ingo Molnar
2007-10-02 20:22 ` Randy Dunlap [this message]
2007-10-02 20:57 ` Paul Jackson
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=20071002132214.330ae2ca.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=cpw@sgi.com \
--cc=dino@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=mingo@elte.hu \
--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 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.