public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/5] cpusets: add fundamental functions for recording
@ 2012-07-17  9:04 Michael Wang
  0 siblings, 0 replies; only message in thread
From: Michael Wang @ 2012-07-17  9:04 UTC (permalink / raw)
  To: LKML; +Cc: mingo, Peter Zijlstra, paul

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-17  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-17  9:04 [PATCH 4/5] cpusets: add fundamental functions for recording Michael Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox