aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-09-12 10:12:08 -0400
committerTejun Heo <tj@kernel.org>2012-09-14 12:57:47 -0400
commita6f00298b2ceaf50b4ab00e6ee3eb0206ac72fac (patch)
tree47064dd9fcb48c70b7671dbd93c12281e1022d84 /include/linux/cgroup.h
parent8a8e04df4747661daaee77e98e102d99c9e09b98 (diff)
cgroup: Define CGROUP_SUBSYS_COUNT according the configuration
Since we know exactly how many subsystems exists at compile time we are able to define CGROUP_SUBSYS_COUNT correctly. CGROUP_SUBSYS_COUNT will be at max 12 (all controllers enabled). Depending on the architecture we safe either 32 - 12 pointers (80 bytes) or 64 - 12 pointers (416 bytes) per cgroup. With this change we can also remove the temporary placeholder to avoid compilation errors. Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Cc: Gao feng <gaofeng@cn.fujitsu.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: John Fastabend <john.r.fastabend@intel.com> Cc: netdev@vger.kernel.org Cc: cgroups@vger.kernel.org
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 018f819405c8..df354ae079c1 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -49,16 +49,10 @@ extern const struct file_operations proc_cgroup_operations;
49#define IS_SUBSYS_ENABLED(option) IS_ENABLED(option) 49#define IS_SUBSYS_ENABLED(option) IS_ENABLED(option)
50enum cgroup_subsys_id { 50enum cgroup_subsys_id {
51#include <linux/cgroup_subsys.h> 51#include <linux/cgroup_subsys.h>
52 __CGROUP_TEMPORARY_PLACEHOLDER 52 CGROUP_SUBSYS_COUNT,
53}; 53};
54#undef IS_SUBSYS_ENABLED 54#undef IS_SUBSYS_ENABLED
55#undef SUBSYS 55#undef SUBSYS
56/*
57 * This define indicates the maximum number of subsystems that can be loaded
58 * at once. We limit to this many since cgroupfs_root has subsys_bits to keep
59 * track of all of them.
60 */
61#define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long))
62 56
63/* Per-subsystem/per-cgroup state maintained by the system. */ 57/* Per-subsystem/per-cgroup state maintained by the system. */
64struct cgroup_subsys_state { 58struct cgroup_subsys_state {