mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON
authorVlastimil Babka <vbabka@suse.cz>
Wed, 24 Feb 2021 20:01:22 +0000 (12:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 24 Feb 2021 21:38:27 +0000 (13:38 -0800)
The boot param and config determine the value of memcg_sysfs_enabled,
which is unused since commit 10befea91b61 ("mm: memcg/slab: use a single
set of kmem_caches for all allocations") as there are no per-memcg kmem
caches anymore.

Link: https://lkml.kernel.org/r/20210127124745.7928-1-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/admin-guide/kernel-parameters.txt
init/Kconfig
mm/slub.c

index 0ac8837773184da227b9779b506a62ed6bcf5b04..19cfa8b9eb60781db6176ccd4a8325b6eb028d62 100644 (file)
                        last alloc / free. For more information see
                        Documentation/vm/slub.rst.
 
-       slub_memcg_sysfs=       [MM, SLUB]
-                       Determines whether to enable sysfs directories for
-                       memory cgroup sub-caches. 1 to enable, 0 to disable.
-                       The default is determined by CONFIG_SLUB_MEMCG_SYSFS_ON.
-                       Enabling this can lead to a very high number of debug
-                       directories and files being created under
-                       /sys/kernel/slub.
-
        slub_max_order= [MM, SLUB]
                        Determines the maximum allowed order for slabs.
                        A high setting may cause OOMs due to memory
index ba8bd5256980d7ad95048606862b5b9217ca9416..8f3a6c4fc0b47996f74eefdf323335151fc7e709 100644 (file)
@@ -1861,20 +1861,6 @@ config SLUB_DEBUG
          SLUB sysfs support. /sys/slab will not exist and there will be
          no support for cache validation etc.
 
-config SLUB_MEMCG_SYSFS_ON
-       default n
-       bool "Enable memcg SLUB sysfs support by default" if EXPERT
-       depends on SLUB && SYSFS && MEMCG
-       help
-         SLUB creates a directory under /sys/kernel/slab for each
-         allocation cache to host info and debug files. If memory
-         cgroup is enabled, each cache can have per memory cgroup
-         caches. SLUB can create the same sysfs directories for these
-         caches under /sys/kernel/slab/CACHE/cgroup but it can lead
-         to a very high number of debug files being created. This is
-         controlled by slub_memcg_sysfs boot parameter and this
-         config option determines the parameter's default value.
-
 config COMPAT_BRK
        bool "Disable heap randomization"
        default y
index 13e5821ce3e24eb05ee72602e2d091348d4df174..49d10e0afb76513448a1a5cd9401972e0e765b7c 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4943,22 +4943,6 @@ enum slab_stat_type {
 #define SO_OBJECTS     (1 << SL_OBJECTS)
 #define SO_TOTAL       (1 << SL_TOTAL)
 
-#ifdef CONFIG_MEMCG
-static bool memcg_sysfs_enabled = IS_ENABLED(CONFIG_SLUB_MEMCG_SYSFS_ON);
-
-static int __init setup_slub_memcg_sysfs(char *str)
-{
-       int v;
-
-       if (get_option(&str, &v) > 0)
-               memcg_sysfs_enabled = v;
-
-       return 1;
-}
-
-__setup("slub_memcg_sysfs=", setup_slub_memcg_sysfs);
-#endif
-
 static ssize_t show_slab_objects(struct kmem_cache *s,
                                 char *buf, unsigned long flags)
 {