From: Michael Wang <wangyun@linux.vnet.ibm.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: mingo@redhat.com, Peter Zijlstra <peterz@infradead.org>,
paul@paulmenage.org
Subject: [PATCH 3/5] cpusets: enable the dynamical domain flags
Date: Tue, 17 Jul 2012 17:04:05 +0800 [thread overview]
Message-ID: <50052A85.7070305@linux.vnet.ibm.com> (raw)
From: Michael Wang <wangyun@linux.vnet.ibm.com>
We will record the domain flags for cpuset in update_domain_attr and
use it to replace the static domain flags in set_domain_attribute.
Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
---
kernel/cpuset.c | 7 +++++++
kernel/sched/core.c | 10 +++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 67ee111..def8080 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -476,8 +476,15 @@ static int cpusets_overlap(struct cpuset *a, struct cpuset *b)
static void
update_domain_attr(struct sched_domain_attr *dattr, struct cpuset *c)
{
+ int i;
if (dattr->relax_domain_level < c->relax_domain_level)
dattr->relax_domain_level = c->relax_domain_level;
+ /* record all the domain flags if cpuset want to use them */
+ if (c->enable_ddf) {
+ dattr->enable_ddf = 1;
+ for (i = 0; i < MAX_DDF; i++)
+ dattr->ddf[i] = c->ddf[i];
+ }
return;
}
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3f9d368..7a1c886 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6461,7 +6461,15 @@ static void set_domain_attribute(struct sched_domain *sd,
{
int request;
- if (!attr || attr->relax_domain_level < 0) {
+ if (!attr)
+ return;
+
+ if (attr->enable_ddf) {
+ /* replace domain flags with ddf according to level */
+ sd->flags = attr->ddf[sd->level];
+ }
+
+ if (attr->relax_domain_level < 0) {
if (default_relax_domain_level < 0)
return;
else
--
1.7.4.1
reply other threads:[~2012-07-17 9:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=50052A85.7070305@linux.vnet.ibm.com \
--to=wangyun@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paul@paulmenage.org \
--cc=peterz@infradead.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