[RFC 5/5] sched: add cpusets to comounts list
From: Glauber Costa
Date: Tue Sep 04 2012 - 10:22:28 EST
Although we have not yet identified any place where cpusets could be
improved performance-wise by guaranteeing comounts with the other two
cpu cgroups, it is a sane choice to mount them together.
We can preemptively benefit from it and avoid a growing mess, by
guaranteeing that subsystems that mostly contraint the same kind of
resource will live together. With cgroups is never that simple, and
things crosses boundaries quite often. But I hope this can be seen as a
potential improvement.
Signed-off-by: Glauber Costa <glommer@xxxxxxxxxxxxx>
CC: Dave Jones <davej@xxxxxxxxxx>
CC: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
CC: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
CC: Paul Turner <pjt@xxxxxxxxxx>
CC: Lennart Poettering <lennart@xxxxxxxxxxxxxx>
CC: Kay Sievers <kay.sievers@xxxxxxxx>
CC: Tejun Heo <tj@xxxxxxxxxx>
---
kernel/cpuset.c | 4 ++++
kernel/sched/core.c | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 8c8bd65..f8e1c49 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1879,6 +1879,10 @@ struct cgroup_subsys cpuset_subsys = {
.post_clone = cpuset_post_clone,
.subsys_id = cpuset_subsys_id,
.base_cftypes = files,
+#ifdef CONFIG_CGROUP_FORCE_COMOUNT_CPU
+ .comounts = 2,
+ .must_comount = { cpu_cgroup_subsys_id, cpuacct_subsys_id, },
+#endif
.early_init = 1,
};
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d654bd1..aeff02c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8301,8 +8301,8 @@ struct cgroup_subsys cpu_cgroup_subsys = {
.subsys_id = cpu_cgroup_subsys_id,
.base_cftypes = cpu_files,
#ifdef CONFIG_CGROUP_FORCE_COMOUNT_CPU
- .comounts = 1,
- .must_comount = { cpuacct_subsys_id, },
+ .comounts = 2,
+ .must_comount = { cpuacct_subsys_id, cpuset_subsys_id, },
.bind = cpu_cgroup_bind,
#endif
.early_init = 1,
@@ -8637,8 +8637,8 @@ struct cgroup_subsys cpuacct_subsys = {
.base_cftypes = files,
.bind = cpuacct_bind,
#ifdef CONFIG_CGROUP_FORCE_COMOUNT_CPU
- .comounts = 1,
- .must_comount = { cpu_cgroup_subsys_id, },
+ .comounts = 2,
+ .must_comount = { cpu_cgroup_subsys_id, cpuset_subsys_id, },
#endif
};
#endif /* CONFIG_CGROUP_CPUACCT */
--
1.7.11.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/