[<prev] [next>] [day] [month] [year] [list]
Message-ID: <50052A89.3070304@linux.vnet.ibm.com>
Date: Tue, 17 Jul 2012 17:04:09 +0800
From: Michael Wang <wangyun@...ux.vnet.ibm.com>
To: LKML <linux-kernel@...r.kernel.org>
CC: mingo@...hat.com, Peter Zijlstra <peterz@...radead.org>,
paul@...lmenage.org
Subject: [PATCH 4/5] cpusets: add fundamental functions for recording
From: Michael Wang <wangyun@...ux.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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists