From: Michael Wang <wang...@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 <wang...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to