From: Daniel Wagner Date: Wed, 12 Sep 2012 14:12:08 +0000 (+0200) Subject: cgroup: Define CGROUP_SUBSYS_COUNT according the configuration X-Git-Tag: firefly_0821_release~3680^2~1953^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a6f00298b2ceaf50b4ab00e6ee3eb0206ac72fac;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Tejun Heo Acked-by: Li Zefan Acked-by: Neil Horman Cc: Gao feng Cc: Jamal Hadi Salim Cc: John Fastabend Cc: netdev@vger.kernel.org Cc: cgroups@vger.kernel.org --- 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; #define IS_SUBSYS_ENABLED(option) IS_ENABLED(option) enum cgroup_subsys_id { #include - __CGROUP_TEMPORARY_PLACEHOLDER + CGROUP_SUBSYS_COUNT, }; #undef IS_SUBSYS_ENABLED #undef SUBSYS -/* - * This define indicates the maximum number of subsystems that can be loaded - * at once. We limit to this many since cgroupfs_root has subsys_bits to keep - * track of all of them. - */ -#define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long)) /* Per-subsystem/per-cgroup state maintained by the system. */ struct cgroup_subsys_state {