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 4/5] cpusets: add fundamental functions for recording
Date: Tue, 17 Jul 2012 17:04:09 +0800 [thread overview]
Message-ID: <50052A89.3070304@linux.vnet.ibm.com> (raw)
From: Michael Wang <wangyun@linux.vnet.ibm.com>
Add the fundamental functions which will help to record the status of
dynamical domain flags for cpuset.
Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
---
kernel/cpuset.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index def8080..066c61c 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1189,6 +1189,37 @@ static int update_relax_domain_level(struct cpuset *cs, s64 val)
}
/*
+ * update the ddf of cs according to level and rebuild domain
+ * if ddf enabled.
+ */
+static int update_ddf(int level, struct cpuset *cs, u64 val)
+{
+ if (!is_sched_load_balance(cs))
+ return -EINVAL;
+
+ cs->ddf[level] = val;
+ if (cs->enable_ddf)
+ async_rebuild_sched_domains();
+
+ return 0;
+}
+
+/* enable or disable ddf supporting and rebuild domain */
+static int enable_ddf(struct cpuset *cs, u64 val)
+{
+ if (!is_sched_load_balance(cs))
+ return -EINVAL;
+
+ if ((val != 0 && val != 1) || cs->enable_ddf == val)
+ return -EINVAL;
+
+ cs->enable_ddf = val;
+ async_rebuild_sched_domains();
+
+ return 0;
+}
+
+/*
* cpuset_change_flag - make a task's spread flags the same as its cpuset's
* @tsk: task to be updated
* @scan: struct cgroup_scanner containing the cgroup of the task
--
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=50052A89.3070304@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