linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON
@ 2021-01-27 12:47 Vlastimil Babka
  2021-01-27 13:59 ` David Hildenbrand
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vlastimil Babka @ 2021-01-27 12:47 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton
  Cc: linux-mm, linux-kernel, Roman Gushchin, Vlastimil Babka

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.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 Documentation/admin-guide/kernel-parameters.txt |  8 --------
 init/Kconfig                                    | 14 --------------
 mm/slub.c                                       | 16 ----------------
 3 files changed, 38 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index f4497faef266..7dc351da0005 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4892,14 +4892,6 @@
 			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
diff --git a/init/Kconfig b/init/Kconfig
index e4e2932da237..af454a51f3c5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1851,20 +1851,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
diff --git a/mm/slub.c b/mm/slub.c
index 1b5148747c64..88782727412c 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5040,22 +5040,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)
 {
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON
  2021-01-27 12:47 [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON Vlastimil Babka
@ 2021-01-27 13:59 ` David Hildenbrand
  2021-01-27 18:19 ` Roman Gushchin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2021-01-27 13:59 UTC (permalink / raw)
  To: Vlastimil Babka, Christoph Lameter, Pekka Enberg, David Rientjes,
	Joonsoo Kim, Andrew Morton
  Cc: linux-mm, linux-kernel, Roman Gushchin

On 27.01.21 13:47, Vlastimil Babka wrote:
> 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.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---
>   Documentation/admin-guide/kernel-parameters.txt |  8 --------
>   init/Kconfig                                    | 14 --------------
>   mm/slub.c                                       | 16 ----------------
>   3 files changed, 38 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index f4497faef266..7dc351da0005 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4892,14 +4892,6 @@
>   			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
> diff --git a/init/Kconfig b/init/Kconfig
> index e4e2932da237..af454a51f3c5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1851,20 +1851,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
> diff --git a/mm/slub.c b/mm/slub.c
> index 1b5148747c64..88782727412c 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -5040,22 +5040,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)
>   {
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON
  2021-01-27 12:47 [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON Vlastimil Babka
  2021-01-27 13:59 ` David Hildenbrand
@ 2021-01-27 18:19 ` Roman Gushchin
  2021-01-27 19:18 ` David Rientjes
  2021-01-28  2:25 ` Miaohe Lin
  3 siblings, 0 replies; 5+ messages in thread
From: Roman Gushchin @ 2021-01-27 18:19 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, linux-mm, linux-kernel

On Wed, Jan 27, 2021 at 01:47:45PM +0100, Vlastimil Babka wrote:
> 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.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Nice cleanup!

Acked-by: Roman Gushchin <guro@fb.com>

Thanks, Vlastimil!
> ---
>  Documentation/admin-guide/kernel-parameters.txt |  8 --------
>  init/Kconfig                                    | 14 --------------
>  mm/slub.c                                       | 16 ----------------
>  3 files changed, 38 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index f4497faef266..7dc351da0005 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4892,14 +4892,6 @@
>  			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
> diff --git a/init/Kconfig b/init/Kconfig
> index e4e2932da237..af454a51f3c5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1851,20 +1851,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
> diff --git a/mm/slub.c b/mm/slub.c
> index 1b5148747c64..88782727412c 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -5040,22 +5040,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)
>  {
> -- 
> 2.30.0
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON
  2021-01-27 12:47 [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON Vlastimil Babka
  2021-01-27 13:59 ` David Hildenbrand
  2021-01-27 18:19 ` Roman Gushchin
@ 2021-01-27 19:18 ` David Rientjes
  2021-01-28  2:25 ` Miaohe Lin
  3 siblings, 0 replies; 5+ messages in thread
From: David Rientjes @ 2021-01-27 19:18 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Christoph Lameter, Pekka Enberg, Joonsoo Kim, Andrew Morton,
	linux-mm, linux-kernel, Roman Gushchin

On Wed, 27 Jan 2021, Vlastimil Babka wrote:

> 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.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON
  2021-01-27 12:47 [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON Vlastimil Babka
                   ` (2 preceding siblings ...)
  2021-01-27 19:18 ` David Rientjes
@ 2021-01-28  2:25 ` Miaohe Lin
  3 siblings, 0 replies; 5+ messages in thread
From: Miaohe Lin @ 2021-01-28  2:25 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: linux-mm, linux-kernel, Roman Gushchin, Christoph Lameter,
	Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton

Hi:
On 2021/1/27 20:47, Vlastimil Babka wrote:
> 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.
> 

Good catch. Thanks.
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---
>  Documentation/admin-guide/kernel-parameters.txt |  8 --------
>  init/Kconfig                                    | 14 --------------
>  mm/slub.c                                       | 16 ----------------
>  3 files changed, 38 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index f4497faef266..7dc351da0005 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4892,14 +4892,6 @@
>  			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
> diff --git a/init/Kconfig b/init/Kconfig
> index e4e2932da237..af454a51f3c5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1851,20 +1851,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
> diff --git a/mm/slub.c b/mm/slub.c
> index 1b5148747c64..88782727412c 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -5040,22 +5040,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)
>  {
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-28  2:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 12:47 [PATCH] mm, slub: remove slub_memcg_sysfs boot param and CONFIG_SLUB_MEMCG_SYSFS_ON Vlastimil Babka
2021-01-27 13:59 ` David Hildenbrand
2021-01-27 18:19 ` Roman Gushchin
2021-01-27 19:18 ` David Rientjes
2021-01-28  2:25 ` Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).