mm: move KMEMLEAK's Kconfig items from lib to mm
authorZhaoyang Huang <zhaoyang.huang@unisoc.com>
Thu, 19 Jan 2023 01:22:24 +0000 (09:22 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:26 +0000 (22:33 -0800)
Have the kmemleak's source code and Kconfig items be in the same directory.

Link: https://lkml.kernel.org/r/1674091345-14799-1-git-send-email-zhaoyang.huang@unisoc.com
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: ke.wang <ke.wang@unisoc.com>
Cc: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/Kconfig.debug
mm/Kconfig.debug

index 139758854ce6ab1b1965e741afb1e91dded49ff2..958087475edbbce84d98c668550429af441acf38 100644 (file)
@@ -743,77 +743,6 @@ config SHRINKER_DEBUG
          visibility into the kernel memory shrinkers subsystem.
          Disable it to avoid an extra memory footprint.
 
-config HAVE_DEBUG_KMEMLEAK
-       bool
-
-config DEBUG_KMEMLEAK
-       bool "Kernel memory leak detector"
-       depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
-       select DEBUG_FS
-       select STACKTRACE if STACKTRACE_SUPPORT
-       select KALLSYMS
-       select CRC32
-       select STACKDEPOT
-       select STACKDEPOT_ALWAYS_INIT if !DEBUG_KMEMLEAK_DEFAULT_OFF
-       help
-         Say Y here if you want to enable the memory leak
-         detector. The memory allocation/freeing is traced in a way
-         similar to the Boehm's conservative garbage collector, the
-         difference being that the orphan objects are not freed but
-         only shown in /sys/kernel/debug/kmemleak. Enabling this
-         feature will introduce an overhead to memory
-         allocations. See Documentation/dev-tools/kmemleak.rst for more
-         details.
-
-         Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
-         of finding leaks due to the slab objects poisoning.
-
-         In order to access the kmemleak file, debugfs needs to be
-         mounted (usually at /sys/kernel/debug).
-
-config DEBUG_KMEMLEAK_MEM_POOL_SIZE
-       int "Kmemleak memory pool size"
-       depends on DEBUG_KMEMLEAK
-       range 200 1000000
-       default 16000
-       help
-         Kmemleak must track all the memory allocations to avoid
-         reporting false positives. Since memory may be allocated or
-         freed before kmemleak is fully initialised, use a static pool
-         of metadata objects to track such callbacks. After kmemleak is
-         fully initialised, this memory pool acts as an emergency one
-         if slab allocations fail.
-
-config DEBUG_KMEMLEAK_TEST
-       tristate "Simple test for the kernel memory leak detector"
-       depends on DEBUG_KMEMLEAK && m
-       help
-         This option enables a module that explicitly leaks memory.
-
-         If unsure, say N.
-
-config DEBUG_KMEMLEAK_DEFAULT_OFF
-       bool "Default kmemleak to off"
-       depends on DEBUG_KMEMLEAK
-       help
-         Say Y here to disable kmemleak by default. It can then be enabled
-         on the command line via kmemleak=on.
-
-config DEBUG_KMEMLEAK_AUTO_SCAN
-       bool "Enable kmemleak auto scan thread on boot up"
-       default y
-       depends on DEBUG_KMEMLEAK
-       help
-         Depending on the cpu, kmemleak scan may be cpu intensive and can
-         stall user tasks at times. This option enables/disables automatic
-         kmemleak scan at boot up.
-
-         Say N here to disable kmemleak auto scan thread to stop automatic
-         scanning. Disabling this option disables automatic reporting of
-         memory leaks.
-
-         If unsure, say Y.
-
 config DEBUG_STACK_USAGE
        bool "Stack utilization instrumentation"
        depends on DEBUG_KERNEL && !IA64
index d62f481319526570774cdf7d08abba61fd6179eb..c3547a373c9cafdc73e5c7b2353600c23a8f5a2c 100644 (file)
@@ -207,3 +207,75 @@ config PTDUMP_DEBUGFS
          kernel.
 
          If in doubt, say N.
+
+config HAVE_DEBUG_KMEMLEAK
+       bool
+
+config DEBUG_KMEMLEAK
+       bool "Kernel memory leak detector"
+       depends on DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK
+       select DEBUG_FS
+       select STACKTRACE if STACKTRACE_SUPPORT
+       select KALLSYMS
+       select CRC32
+       select STACKDEPOT
+       select STACKDEPOT_ALWAYS_INIT if !DEBUG_KMEMLEAK_DEFAULT_OFF
+       help
+         Say Y here if you want to enable the memory leak
+         detector. The memory allocation/freeing is traced in a way
+         similar to the Boehm's conservative garbage collector, the
+         difference being that the orphan objects are not freed but
+         only shown in /sys/kernel/debug/kmemleak. Enabling this
+         feature will introduce an overhead to memory
+         allocations. See Documentation/dev-tools/kmemleak.rst for more
+         details.
+
+         Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
+         of finding leaks due to the slab objects poisoning.
+
+         In order to access the kmemleak file, debugfs needs to be
+         mounted (usually at /sys/kernel/debug).
+
+config DEBUG_KMEMLEAK_MEM_POOL_SIZE
+       int "Kmemleak memory pool size"
+       depends on DEBUG_KMEMLEAK
+       range 200 1000000
+       default 16000
+       help
+         Kmemleak must track all the memory allocations to avoid
+         reporting false positives. Since memory may be allocated or
+         freed before kmemleak is fully initialised, use a static pool
+         of metadata objects to track such callbacks. After kmemleak is
+         fully initialised, this memory pool acts as an emergency one
+         if slab allocations fail.
+
+config DEBUG_KMEMLEAK_TEST
+       tristate "Simple test for the kernel memory leak detector"
+       depends on DEBUG_KMEMLEAK && m
+       help
+         This option enables a module that explicitly leaks memory.
+
+         If unsure, say N.
+
+config DEBUG_KMEMLEAK_DEFAULT_OFF
+       bool "Default kmemleak to off"
+       depends on DEBUG_KMEMLEAK
+       help
+         Say Y here to disable kmemleak by default. It can then be enabled
+         on the command line via kmemleak=on.
+
+config DEBUG_KMEMLEAK_AUTO_SCAN
+       bool "Enable kmemleak auto scan thread on boot up"
+       default y
+       depends on DEBUG_KMEMLEAK
+       help
+         Depending on the cpu, kmemleak scan may be cpu intensive and can
+         stall user tasks at times. This option enables/disables automatic
+         kmemleak scan at boot up.
+
+         Say N here to disable kmemleak auto scan thread to stop automatic
+         scanning. Disabling this option disables automatic reporting of
+         memory leaks.
+
+         If unsure, say Y.
+