All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet
@ 2013-07-01 20:04 Dave Hansen
  2013-07-01 20:04 ` [PATCH 1/7] consolidate per-arch stack overflow debugging options Dave Hansen
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen

Linus, I've tried to send these along to a couple of different
maintainers for a couple of merge windows, but so far nobody has
bitten.

--

I think the "Kernel Hacking" menu has gotten a bit out of hand.  It
is over 120 lines long on my system with everything enabled and
options are scattered around it haphazardly.

        http://sr71.net/~dave/linux/kconfig-horror.png

Let's try to introduce some sanity.  This set takes that 120 lines
down to 55 and makes it vastly easier to find some things.  It's a
start.

This set stands on its own, but there is plenty of room for follow-up
patches.  The arch-specific debug options still end up getting stuck
in the top-level "kernel hacking" menu.  OPTIMIZE_INLINING, for
instance, could obviously go in to the "compiler options" menu, but
the fact that it is defined in arch/ in a separate Kconfig file keeps
it on its own for the moment.

--

There is a fair amount of churn in the areas around these patches
so I've resolved conflicts a couple of times.  For the patches that
are almost purely code move patches, I'm doing this:

	cat foo.patch | grep '^[-+]' | perl -pe 's/^.//' | sort | uniq -c | sort -n

and watching for any non-even numbers coming out of uniq.  This
helps me make sure I'm not adding/removing code that I should not
be.

The Signed-off-by's in here look funky.  I changed employers
while working on this set, so I have signoffs from both email
addresses.  Here's the original posting:

	http://lkml.kernel.org/r/20121217182206.91AA150A@kernel.stglabs.ibm.com


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

* [PATCH 1/7] consolidate per-arch stack overflow debugging options
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  2013-07-01 20:04 ` [PATCH 2/7] order memory debugging Kconfig options Dave Hansen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave@linux.vnet.ibm.com>

Original posting:

	http://lkml.kernel.org/r/20121214184202.F54094D9@kernel.stglabs.ibm.com

Several architectures have similar stack debugging config options.
They all pretty much do the same thing, some with slightly
differing help text.

This patch changes the architectures to instead enable a Kconfig
boolean, and then use that boolean in the generic Kconfig.debug
to present the actual menu option.  This removes a bunch of
duplication and adds consistency across arches.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com> [for tile]
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/arch/arc/Kconfig            |    1 +
 linux.git-davehans/arch/arc/Kconfig.debug      |    7 -------
 linux.git-davehans/arch/blackfin/Kconfig       |    1 +
 linux.git-davehans/arch/blackfin/Kconfig.debug |    7 -------
 linux.git-davehans/arch/frv/Kconfig            |    1 +
 linux.git-davehans/arch/frv/Kconfig.debug      |    4 ----
 linux.git-davehans/arch/m32r/Kconfig           |    1 +
 linux.git-davehans/arch/m32r/Kconfig.debug     |    7 -------
 linux.git-davehans/arch/metag/Kconfig          |    1 +
 linux.git-davehans/arch/metag/Kconfig.debug    |    7 -------
 linux.git-davehans/arch/mips/Kconfig           |    1 +
 linux.git-davehans/arch/mips/Kconfig.debug     |    9 ---------
 linux.git-davehans/arch/mn10300/Kconfig        |    1 +
 linux.git-davehans/arch/mn10300/Kconfig.debug  |    4 ----
 linux.git-davehans/arch/openrisc/Kconfig       |   11 +----------
 linux.git-davehans/arch/parisc/Kconfig         |    1 +
 linux.git-davehans/arch/parisc/Kconfig.debug   |   11 -----------
 linux.git-davehans/arch/powerpc/Kconfig        |    1 +
 linux.git-davehans/arch/powerpc/Kconfig.debug  |    7 -------
 linux.git-davehans/arch/tile/Kconfig           |    1 +
 linux.git-davehans/arch/tile/Kconfig.debug     |    7 -------
 linux.git-davehans/arch/x86/Kconfig            |    1 +
 linux.git-davehans/arch/x86/Kconfig.debug      |   10 ----------
 linux.git-davehans/lib/Kconfig.debug           |   21 +++++++++++++++++++++
 24 files changed, 33 insertions(+), 90 deletions(-)

diff -puN arch/arc/Kconfig~consolidat-stack-debugging-configs arch/arc/Kconfig
--- linux.git/arch/arc/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.213474005 -0700
+++ linux.git-davehans/arch/arc/Kconfig	2013-07-01 12:53:20.255475867 -0700
@@ -34,6 +34,7 @@ config ARC
 	select OF
 	select OF_EARLY_FLATTREE
 	select PERF_USE_VMALLOC
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config SCHED_OMIT_FRAME_POINTER
 	def_bool y
diff -puN arch/arc/Kconfig.debug~consolidat-stack-debugging-configs arch/arc/Kconfig.debug
--- linux.git/arch/arc/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.214474050 -0700
+++ linux.git-davehans/arch/arc/Kconfig.debug	2013-07-01 12:53:20.256475912 -0700
@@ -15,13 +15,6 @@ config EARLY_PRINTK
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash.
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit.
-
 config 16KSTACKS
 	bool "Use 16Kb for kernel stacks instead of 8Kb"
 	help
diff -puN arch/blackfin/Kconfig~consolidat-stack-debugging-configs arch/blackfin/Kconfig
--- linux.git/arch/blackfin/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.216474138 -0700
+++ linux.git-davehans/arch/blackfin/Kconfig	2013-07-01 12:53:20.256475912 -0700
@@ -41,6 +41,7 @@ config BLACKFIN
 	select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
 	select HAVE_MOD_ARCH_SPECIFIC
 	select MODULES_USE_ELF_RELA
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config GENERIC_CSUM
 	def_bool y
diff -puN arch/blackfin/Kconfig.debug~consolidat-stack-debugging-configs arch/blackfin/Kconfig.debug
--- linux.git/arch/blackfin/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.218474227 -0700
+++ linux.git-davehans/arch/blackfin/Kconfig.debug	2013-07-01 12:53:20.257475956 -0700
@@ -2,13 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit.
-
 config DEBUG_VERBOSE
 	bool "Verbose fault messages"
 	default y
diff -puN arch/frv/Kconfig~consolidat-stack-debugging-configs arch/frv/Kconfig
--- linux.git/arch/frv/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.220474316 -0700
+++ linux.git-davehans/arch/frv/Kconfig	2013-07-01 12:53:20.257475956 -0700
@@ -14,6 +14,7 @@ config FRV
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select OLD_SIGSUSPEND3
 	select OLD_SIGACTION
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config ZONE_DMA
 	bool
diff -puN arch/frv/Kconfig.debug~consolidat-stack-debugging-configs arch/frv/Kconfig.debug
--- linux.git/arch/frv/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.221474360 -0700
+++ linux.git-davehans/arch/frv/Kconfig.debug	2013-07-01 12:53:20.258476000 -0700
@@ -2,10 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-
 config GDBSTUB
 	bool "Remote GDB kernel debugging"
 	depends on DEBUG_KERNEL
diff -puN arch/m32r/Kconfig~consolidat-stack-debugging-configs arch/m32r/Kconfig
--- linux.git/arch/m32r/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.223474448 -0700
+++ linux.git-davehans/arch/m32r/Kconfig	2013-07-01 12:53:20.258476000 -0700
@@ -16,6 +16,7 @@ config M32R
 	select GENERIC_ATOMIC64
 	select ARCH_USES_GETTIMEOFFSET
 	select MODULES_USE_ELF_RELA
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config SBUS
 	bool
diff -puN arch/m32r/Kconfig.debug~consolidat-stack-debugging-configs arch/m32r/Kconfig.debug
--- linux.git/arch/m32r/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.225474537 -0700
+++ linux.git-davehans/arch/m32r/Kconfig.debug	2013-07-01 12:53:20.258476000 -0700
@@ -2,13 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit.
-
 config DEBUG_PAGEALLOC
 	bool "Debug page memory allocations"
 	depends on DEBUG_KERNEL && BROKEN
diff -puN arch/metag/Kconfig~consolidat-stack-debugging-configs arch/metag/Kconfig
--- linux.git/arch/metag/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.226474582 -0700
+++ linux.git-davehans/arch/metag/Kconfig	2013-07-01 12:53:20.259476044 -0700
@@ -30,6 +30,7 @@ config METAG
 	select OF
 	select OF_EARLY_FLATTREE
 	select SPARSE_IRQ
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config STACKTRACE_SUPPORT
 	def_bool y
diff -puN arch/metag/Kconfig.debug~consolidat-stack-debugging-configs arch/metag/Kconfig.debug
--- linux.git/arch/metag/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.228474670 -0700
+++ linux.git-davehans/arch/metag/Kconfig.debug	2013-07-01 12:53:20.259476044 -0700
@@ -6,13 +6,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit.
-
 config 4KSTACKS
 	bool "Use 4Kb for kernel stacks instead of 8Kb"
 	depends on DEBUG_KERNEL
diff -puN arch/mips/Kconfig~consolidat-stack-debugging-configs arch/mips/Kconfig
--- linux.git/arch/mips/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.230474759 -0700
+++ linux.git-davehans/arch/mips/Kconfig	2013-07-01 12:53:20.260476089 -0700
@@ -42,6 +42,7 @@ config MIPS
 	select MODULES_USE_ELF_REL if MODULES
 	select MODULES_USE_ELF_RELA if MODULES && 64BIT
 	select CLONE_BACKWARDS
+	select HAVE_DEBUG_STACKOVERFLOW
 
 menu "Machine selection"
 
diff -puN arch/mips/Kconfig.debug~consolidat-stack-debugging-configs arch/mips/Kconfig.debug
--- linux.git/arch/mips/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.231474803 -0700
+++ linux.git-davehans/arch/mips/Kconfig.debug	2013-07-01 12:53:20.260476089 -0700
@@ -67,15 +67,6 @@ config CMDLINE_OVERRIDE
 
 	  Normally, you will choose 'N' here.
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit(2GB on MIPS). The debugging option
-	  provides another way to check stack overflow happened on kernel mode
-	  stack usually caused by nested interruption.
-
 config SMTC_IDLE_HOOK_DEBUG
 	bool "Enable additional debug checks before going into CPU idle loop"
 	depends on DEBUG_KERNEL && MIPS_MT_SMTC
diff -puN arch/mn10300/Kconfig~consolidat-stack-debugging-configs arch/mn10300/Kconfig
--- linux.git/arch/mn10300/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.233474892 -0700
+++ linux.git-davehans/arch/mn10300/Kconfig	2013-07-01 12:53:20.261476133 -0700
@@ -13,6 +13,7 @@ config MN10300
 	select MODULES_USE_ELF_RELA
 	select OLD_SIGSUSPEND3
 	select OLD_SIGACTION
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config AM33_2
 	def_bool n
diff -puN arch/mn10300/Kconfig.debug~consolidat-stack-debugging-configs arch/mn10300/Kconfig.debug
--- linux.git/arch/mn10300/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.235474981 -0700
+++ linux.git-davehans/arch/mn10300/Kconfig.debug	2013-07-01 12:53:20.261476133 -0700
@@ -2,10 +2,6 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-
 config DEBUG_DECOMPRESS_KERNEL
 	bool "Using serial port during decompressing kernel"
 	depends on DEBUG_KERNEL
diff -puN arch/openrisc/Kconfig~consolidat-stack-debugging-configs arch/openrisc/Kconfig
--- linux.git/arch/openrisc/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.237475069 -0700
+++ linux.git-davehans/arch/openrisc/Kconfig	2013-07-01 12:53:20.262476177 -0700
@@ -22,6 +22,7 @@ config OPENRISC
 	select GENERIC_STRNCPY_FROM_USER
 	select GENERIC_STRNLEN_USER
 	select MODULES_USE_ELF_RELA
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config MMU
 	def_bool y
@@ -128,16 +129,6 @@ config CMDLINE
 
 menu "Debugging options"
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for kernel stack overflow"
-	default y
-	help
-	  Make extra checks for space available on stack in some
-          critical functions. This will cause kernel to run a bit slower,
-	  but will catch most of kernel stack overruns and exit gracefully.
-
-	  Say Y if you are unsure.
-
 config JUMP_UPON_UNHANDLED_EXCEPTION
 	bool "Try to die gracefully"
 	default y
diff -puN arch/parisc/Kconfig~consolidat-stack-debugging-configs arch/parisc/Kconfig
--- linux.git/arch/parisc/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.238475113 -0700
+++ linux.git-davehans/arch/parisc/Kconfig	2013-07-01 12:53:20.262476177 -0700
@@ -27,6 +27,7 @@ config PARISC
 	select MODULES_USE_ELF_RELA
 	select CLONE_BACKWARDS
 	select TTY # Needed for pdc_cons.c
+	select HAVE_DEBUG_STACKOVERFLOW
 
 	help
 	  The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff -puN arch/parisc/Kconfig.debug~consolidat-stack-debugging-configs arch/parisc/Kconfig.debug
--- linux.git/arch/parisc/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.240475202 -0700
+++ linux.git-davehans/arch/parisc/Kconfig.debug	2013-07-01 12:53:20.262476177 -0700
@@ -13,14 +13,3 @@ config DEBUG_RODATA
          If in doubt, say "N".
 
 endmenu
-
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	default y
-	depends on DEBUG_KERNEL
-	---help---
-	  Say Y here if you want to check the overflows of kernel, IRQ
-	  and exception stacks. This option will cause messages of the
-	  stacks in detail when free stack space drops below a certain
-	  limit.
-	  If in doubt, say "N".
diff -puN arch/powerpc/Kconfig~consolidat-stack-debugging-configs arch/powerpc/Kconfig
--- linux.git/arch/powerpc/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.242475291 -0700
+++ linux.git-davehans/arch/powerpc/Kconfig	2013-07-01 12:53:20.263476221 -0700
@@ -138,6 +138,7 @@ config PPC
 	select ARCH_USE_BUILTIN_BSWAP
 	select OLD_SIGSUSPEND
 	select OLD_SIGACTION if PPC32
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config EARLY_PRINTK
 	bool
diff -puN arch/powerpc/Kconfig.debug~consolidat-stack-debugging-configs arch/powerpc/Kconfig.debug
--- linux.git/arch/powerpc/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.243475335 -0700
+++ linux.git-davehans/arch/powerpc/Kconfig.debug	2013-07-01 12:53:20.263476221 -0700
@@ -28,13 +28,6 @@ config PRINT_STACK_DEPTH
 	  too small and stack traces cause important information to
 	  scroll off the screen.
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit.
-
 config HCALL_STATS
 	bool "Hypervisor call instrumentation"
 	depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
diff -puN arch/tile/Kconfig~consolidat-stack-debugging-configs arch/tile/Kconfig
--- linux.git/arch/tile/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.245475424 -0700
+++ linux.git-davehans/arch/tile/Kconfig	2013-07-01 12:53:20.264476266 -0700
@@ -25,6 +25,7 @@ config TILE
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_SYSCALL_TRACEPOINTS
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+	select HAVE_DEBUG_STACKOVERFLOW
 
 # FIXME: investigate whether we need/want these options.
 #	select HAVE_IOREMAP_PROT
diff -puN arch/tile/Kconfig.debug~consolidat-stack-debugging-configs arch/tile/Kconfig.debug
--- linux.git/arch/tile/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.247475512 -0700
+++ linux.git-davehans/arch/tile/Kconfig.debug	2013-07-01 12:53:20.264476266 -0700
@@ -14,13 +14,6 @@ config EARLY_PRINTK
 	  with klogd/syslogd. You should normally N here,
 	  unless you want to debug such a crash.
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	help
-	  This option will cause messages to be printed if free stack space
-	  drops below a certain limit.
-
 config DEBUG_EXTRA_FLAGS
 	string "Additional compiler arguments when building with '-g'"
 	depends on DEBUG_INFO
diff -puN arch/x86/Kconfig~consolidat-stack-debugging-configs arch/x86/Kconfig
--- linux.git/arch/x86/Kconfig~consolidat-stack-debugging-configs	2013-07-01 12:53:20.248475557 -0700
+++ linux.git-davehans/arch/x86/Kconfig	2013-07-01 12:53:20.265476311 -0700
@@ -121,6 +121,7 @@ config X86
 	select OLD_SIGACTION if X86_32
 	select COMPAT_OLD_SIGACTION if IA32_EMULATION
 	select RTC_LIB
+	select HAVE_DEBUG_STACKOVERFLOW
 
 config INSTRUCTION_DECODER
 	def_bool y
diff -puN arch/x86/Kconfig.debug~consolidat-stack-debugging-configs arch/x86/Kconfig.debug
--- linux.git/arch/x86/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.250475646 -0700
+++ linux.git-davehans/arch/x86/Kconfig.debug	2013-07-01 12:53:20.266476355 -0700
@@ -59,16 +59,6 @@ config EARLY_PRINTK_DBGP
 	  with klogd/syslogd or the X server. You should normally N here,
 	  unless you want to debug such a crash. You need usb debug device.
 
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL
-	---help---
-	  Say Y here if you want to check the overflows of kernel, IRQ
-	  and exception stacks. This option will cause messages of the
-	  stacks in detail when free stack space drops below a certain
-	  limit.
-	  If in doubt, say "N".
-
 config X86_PTDUMP
 	bool "Export kernel pagetable layout to userspace via debugfs"
 	depends on DEBUG_KERNEL
diff -puN lib/Kconfig.debug~consolidat-stack-debugging-configs lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~consolidat-stack-debugging-configs	2013-07-01 12:53:20.252475734 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:20.266476355 -0700
@@ -1475,6 +1475,27 @@ config ASYNC_RAID6_TEST
 
 	  If unsure, say N.
 
+config HAVE_DEBUG_STACKOVERFLOW
+	bool
+
+config DEBUG_STACKOVERFLOW
+	bool "Check for stack overflows"
+	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
+	---help---
+	  Say Y here if you want to check for overflows of kernel, IRQ
+	  and exception stacks (if your archicture uses them). This
+	  option will show detailed messages if free stack space drops
+	  below a certain limit.
+
+	  These kinds of bugs usually occur when call-chains in the
+	  kernel get too deep, especially when interrupts are
+	  involved.
+
+	  Use this in cases where you see apparently random memory
+	  corruption, especially if it appears in 'struct thread_info'
+
+	  If in doubt, say "N".
+
 source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"
_

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

* [PATCH 2/7] order memory debugging Kconfig options
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
  2013-07-01 20:04 ` [PATCH 1/7] consolidate per-arch stack overflow debugging options Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  2013-07-08 16:43   ` Paul E. McKenney
  2013-07-01 20:04 ` [PATCH 3/7] consolidate runtime testing configs Dave Hansen
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave@linux.vnet.ibm.com>

Original posting:

	http://lkml.kernel.org/r/20121214184203.37E6C724@kernel.stglabs.ibm.com

There are a *LOT* of memory debugging options.  They are just scattered
all over the "Kernel Hacking" menu.  Sure, "memory debugging" is a very
vague term and it's going to be hard to make absolute rules about what
goes in here, but this has to be better than what we had before.

This does, however, leave out the architecture-specific memory
debugging options (like x86's DEBUG_SET_MODULE_RONX).  There would need
to be some substantial changes to move those in here.  Kconfig can not
easily mix arch-specific and generic options together: it really
requires a file per-architecture, and I think having an
arch/foo/Kconfig.debug-memory might be taking things a bit too far

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/lib/Kconfig.debug |  685 +++++++++++++++++------------------
 1 file changed, 345 insertions(+), 340 deletions(-)

diff -puN lib/Kconfig.debug~order-memory-debugging-options lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~order-memory-debugging-options	2013-07-01 12:53:20.740497368 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:20.745497590 -0700
@@ -162,6 +162,283 @@ config DEBUG_KERNEL
 	  Say Y here if you are developing drivers or trying to debug and
 	  identify kernel problems.
 
+menu "Memory Debugging"
+
+source mm/Kconfig.debug
+
+config DEBUG_OBJECTS
+	bool "Debug object operations"
+	depends on DEBUG_KERNEL
+	help
+	  If you say Y here, additional code will be inserted into the
+	  kernel to track the life time of various objects and validate
+	  the operations on those objects.
+
+config DEBUG_OBJECTS_SELFTEST
+	bool "Debug objects selftest"
+	depends on DEBUG_OBJECTS
+	help
+	  This enables the selftest of the object debug code.
+
+config DEBUG_OBJECTS_FREE
+	bool "Debug objects in freed memory"
+	depends on DEBUG_OBJECTS
+	help
+	  This enables checks whether a k/v free operation frees an area
+	  which contains an object which has not been deactivated
+	  properly. This can make kmalloc/kfree-intensive workloads
+	  much slower.
+
+config DEBUG_OBJECTS_TIMERS
+	bool "Debug timer objects"
+	depends on DEBUG_OBJECTS
+	help
+	  If you say Y here, additional code will be inserted into the
+	  timer routines to track the life time of timer objects and
+	  validate the timer operations.
+
+config DEBUG_OBJECTS_WORK
+	bool "Debug work objects"
+	depends on DEBUG_OBJECTS
+	help
+	  If you say Y here, additional code will be inserted into the
+	  work queue routines to track the life time of work objects and
+	  validate the work operations.
+
+config DEBUG_OBJECTS_RCU_HEAD
+	bool "Debug RCU callbacks objects"
+	depends on DEBUG_OBJECTS
+	help
+	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
+
+config DEBUG_OBJECTS_PERCPU_COUNTER
+	bool "Debug percpu counter objects"
+	depends on DEBUG_OBJECTS
+	help
+	  If you say Y here, additional code will be inserted into the
+	  percpu counter routines to track the life time of percpu counter
+	  objects and validate the percpu counter operations.
+
+config DEBUG_OBJECTS_ENABLE_DEFAULT
+	int "debug_objects bootup default value (0-1)"
+        range 0 1
+        default "1"
+        depends on DEBUG_OBJECTS
+        help
+          Debug objects boot parameter default value
+
+config DEBUG_SLAB
+	bool "Debug slab memory allocations"
+	depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
+	help
+	  Say Y here to have the kernel do limited verification on memory
+	  allocation as well as poisoning memory on free to catch use of freed
+	  memory. This can make kmalloc/kfree-intensive workloads much slower.
+
+config DEBUG_SLAB_LEAK
+	bool "Memory leak debugging"
+	depends on DEBUG_SLAB
+
+config SLUB_DEBUG_ON
+	bool "SLUB debugging on by default"
+	depends on SLUB && SLUB_DEBUG && !KMEMCHECK
+	default n
+	help
+	  Boot with debugging on by default. SLUB boots by default with
+	  the runtime debug capabilities switched off. Enabling this is
+	  equivalent to specifying the "slub_debug" parameter on boot.
+	  There is no support for more fine grained debug control like
+	  possible with slub_debug=xxx. SLUB debugging may be switched
+	  off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
+	  "slub_debug=-".
+
+config SLUB_STATS
+	default n
+	bool "Enable SLUB performance statistics"
+	depends on SLUB && SYSFS
+	help
+	  SLUB statistics are useful to debug SLUBs allocation behavior in
+	  order find ways to optimize the allocator. This should never be
+	  enabled for production use since keeping statistics slows down
+	  the allocator by a few percentage points. The slabinfo command
+	  supports the determination of the most active slabs to figure
+	  out which slabs are relevant to a particular load.
+	  Try running: slabinfo -DA
+
+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
+	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/kmemleak.txt 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_EARLY_LOG_SIZE
+	int "Maximum kmemleak early log entries"
+	depends on DEBUG_KMEMLEAK
+	range 200 40000
+	default 400
+	help
+	  Kmemleak must track all the memory allocations to avoid
+	  reporting false positives. Since memory may be allocated or
+	  freed before kmemleak is initialised, an early log buffer is
+	  used to store these actions. If kmemleak reports "early log
+	  buffer exceeded", please increase this value.
+
+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_STACK_USAGE
+	bool "Stack utilization instrumentation"
+	depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
+	help
+	  Enables the display of the minimum amount of free stack which each
+	  task has ever had available in the sysrq-T and sysrq-P debug output.
+
+	  This option will slow down process creation somewhat.
+
+config DEBUG_VM
+	bool "Debug VM"
+	depends on DEBUG_KERNEL
+	help
+	  Enable this to turn on extended checks in the virtual-memory system
+          that may impact performance.
+
+	  If unsure, say N.
+
+config DEBUG_VM_RB
+	bool "Debug VM red-black trees"
+	depends on DEBUG_VM
+	help
+	  Enable this to turn on more extended checks in the virtual-memory
+	  system that may impact performance.
+
+	  If unsure, say N.
+
+config DEBUG_VIRTUAL
+	bool "Debug VM translations"
+	depends on DEBUG_KERNEL && X86
+	help
+	  Enable some costly sanity checks in virtual to page code. This can
+	  catch mistakes with virt_to_page() and friends.
+
+	  If unsure, say N.
+
+config DEBUG_NOMMU_REGIONS
+	bool "Debug the global anon/private NOMMU mapping region tree"
+	depends on DEBUG_KERNEL && !MMU
+	help
+	  This option causes the global tree of anonymous and private mapping
+	  regions to be regularly checked for invalid topology.
+
+config DEBUG_MEMORY_INIT
+	bool "Debug memory initialisation" if EXPERT
+	default !EXPERT
+	help
+	  Enable this for additional checks during memory initialisation.
+	  The sanity checks verify aspects of the VM such as the memory model
+	  and other information provided by the architecture. Verbose
+	  information will be printed at KERN_DEBUG loglevel depending
+	  on the mminit_loglevel= command-line option.
+
+	  If unsure, say Y
+
+config MEMORY_NOTIFIER_ERROR_INJECT
+	tristate "Memory hotplug notifier error injection module"
+	depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
+	help
+	  This option provides the ability to inject artificial errors to
+	  memory hotplug notifier chain callbacks.  It is controlled through
+	  debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
+
+	  If the notifier call chain should be failed with some events
+	  notified, write the error code to "actions/<notifier event>/error".
+
+	  Example: Inject memory hotplug offline error (-12 == -ENOMEM)
+
+	  # cd /sys/kernel/debug/notifier-error-inject/memory
+	  # echo -12 > actions/MEM_GOING_OFFLINE/error
+	  # echo offline > /sys/devices/system/memory/memoryXXX/state
+	  bash: echo: write error: Cannot allocate memory
+
+	  To compile this code as a module, choose M here: the module will
+	  be called memory-notifier-error-inject.
+
+	  If unsure, say N.
+
+config DEBUG_PER_CPU_MAPS
+	bool "Debug access to per_cpu maps"
+	depends on DEBUG_KERNEL
+	depends on SMP
+	help
+	  Say Y to verify that the per_cpu map being accessed has
+	  been set up. This adds a fair amount of code to kernel memory
+	  and decreases performance.
+
+	  Say N if unsure.
+
+config DEBUG_HIGHMEM
+	bool "Highmem debugging"
+	depends on DEBUG_KERNEL && HIGHMEM
+	help
+	  This options enables addition error checking for high memory systems.
+	  Disable for production systems.
+
+config HAVE_DEBUG_STACKOVERFLOW
+	bool
+
+config DEBUG_STACKOVERFLOW
+	bool "Check for stack overflows"
+	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
+	---help---
+	  Say Y here if you want to check for overflows of kernel, IRQ
+	  and exception stacks (if your archicture uses them). This
+	  option will show detailed messages if free stack space drops
+	  below a certain limit.
+
+	  These kinds of bugs usually occur when call-chains in the
+	  kernel get too deep, especially when interrupts are
+	  involved.
+
+	  Use this in cases where you see apparently random memory
+	  corruption, especially if it appears in 'struct thread_info'
+
+	  If in doubt, say "N".
+
+source "lib/Kconfig.kmemcheck"
+
+endmenu # "Memory Debugging"
+
 config DEBUG_SHIRQ
 	bool "Debug shared IRQ handlers"
 	depends on DEBUG_KERNEL && GENERIC_HARDIRQS
@@ -266,241 +543,89 @@ config DETECT_HUNG_TASK
 	depends on DEBUG_KERNEL
 	default LOCKUP_DETECTOR
 	help
-	  Say Y here to enable the kernel to detect "hung tasks",
-	  which are bugs that cause the task to be stuck in
-	  uninterruptible "D" state indefinitiley.
-
-	  When a hung task is detected, the kernel will print the
-	  current stack trace (which you should report), but the
-	  task will stay in uninterruptible state. If lockdep is
-	  enabled then all held locks will also be reported. This
-	  feature has negligible overhead.
-
-config DEFAULT_HUNG_TASK_TIMEOUT
-	int "Default timeout for hung task detection (in seconds)"
-	depends on DETECT_HUNG_TASK
-	default 120
-	help
-	  This option controls the default timeout (in seconds) used
-	  to determine when a task has become non-responsive and should
-	  be considered hung.
-
-	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
-	  sysctl or by writing a value to
-	  /proc/sys/kernel/hung_task_timeout_secs.
-
-	  A timeout of 0 disables the check.  The default is two minutes.
-	  Keeping the default should be fine in most cases.
-
-config BOOTPARAM_HUNG_TASK_PANIC
-	bool "Panic (Reboot) On Hung Tasks"
-	depends on DETECT_HUNG_TASK
-	help
-	  Say Y here to enable the kernel to panic on "hung tasks",
-	  which are bugs that cause the kernel to leave a task stuck
-	  in uninterruptible "D" state.
-
-	  The panic can be used in combination with panic_timeout,
-	  to cause the system to reboot automatically after a
-	  hung task has been detected. This feature is useful for
-	  high-availability systems that have uptime guarantees and
-	  where a hung tasks must be resolved ASAP.
-
-	  Say N if unsure.
-
-config BOOTPARAM_HUNG_TASK_PANIC_VALUE
-	int
-	depends on DETECT_HUNG_TASK
-	range 0 1
-	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
-	default 1 if BOOTPARAM_HUNG_TASK_PANIC
-
-config SCHED_DEBUG
-	bool "Collect scheduler debugging info"
-	depends on DEBUG_KERNEL && PROC_FS
-	default y
-	help
-	  If you say Y here, the /proc/sched_debug file will be provided
-	  that can help debug the scheduler. The runtime overhead of this
-	  option is minimal.
-
-config SCHEDSTATS
-	bool "Collect scheduler statistics"
-	depends on DEBUG_KERNEL && PROC_FS
-	help
-	  If you say Y here, additional code will be inserted into the
-	  scheduler and related routines to collect statistics about
-	  scheduler behavior and provide them in /proc/schedstat.  These
-	  stats may be useful for both tuning and debugging the scheduler
-	  If you aren't debugging the scheduler or trying to tune a specific
-	  application, you can say N to avoid the very slight overhead
-	  this adds.
-
-config TIMER_STATS
-	bool "Collect kernel timers statistics"
-	depends on DEBUG_KERNEL && PROC_FS
-	help
-	  If you say Y here, additional code will be inserted into the
-	  timer routines to collect statistics about kernel timers being
-	  reprogrammed. The statistics can be read from /proc/timer_stats.
-	  The statistics collection is started by writing 1 to /proc/timer_stats,
-	  writing 0 stops it. This feature is useful to collect information
-	  about timer usage patterns in kernel and userspace. This feature
-	  is lightweight if enabled in the kernel config but not activated
-	  (it defaults to deactivated on bootup and will only be activated
-	  if some application like powertop activates it explicitly).
-
-config DEBUG_OBJECTS
-	bool "Debug object operations"
-	depends on DEBUG_KERNEL
-	help
-	  If you say Y here, additional code will be inserted into the
-	  kernel to track the life time of various objects and validate
-	  the operations on those objects.
-
-config DEBUG_OBJECTS_SELFTEST
-	bool "Debug objects selftest"
-	depends on DEBUG_OBJECTS
-	help
-	  This enables the selftest of the object debug code.
-
-config DEBUG_OBJECTS_FREE
-	bool "Debug objects in freed memory"
-	depends on DEBUG_OBJECTS
-	help
-	  This enables checks whether a k/v free operation frees an area
-	  which contains an object which has not been deactivated
-	  properly. This can make kmalloc/kfree-intensive workloads
-	  much slower.
-
-config DEBUG_OBJECTS_TIMERS
-	bool "Debug timer objects"
-	depends on DEBUG_OBJECTS
-	help
-	  If you say Y here, additional code will be inserted into the
-	  timer routines to track the life time of timer objects and
-	  validate the timer operations.
-
-config DEBUG_OBJECTS_WORK
-	bool "Debug work objects"
-	depends on DEBUG_OBJECTS
-	help
-	  If you say Y here, additional code will be inserted into the
-	  work queue routines to track the life time of work objects and
-	  validate the work operations.
-
-config DEBUG_OBJECTS_RCU_HEAD
-	bool "Debug RCU callbacks objects"
-	depends on DEBUG_OBJECTS
-	help
-	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
-
-config DEBUG_OBJECTS_PERCPU_COUNTER
-	bool "Debug percpu counter objects"
-	depends on DEBUG_OBJECTS
-	help
-	  If you say Y here, additional code will be inserted into the
-	  percpu counter routines to track the life time of percpu counter
-	  objects and validate the percpu counter operations.
-
-config DEBUG_OBJECTS_ENABLE_DEFAULT
-	int "debug_objects bootup default value (0-1)"
-        range 0 1
-        default "1"
-        depends on DEBUG_OBJECTS
-        help
-          Debug objects boot parameter default value
-
-config DEBUG_SLAB
-	bool "Debug slab memory allocations"
-	depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
-	help
-	  Say Y here to have the kernel do limited verification on memory
-	  allocation as well as poisoning memory on free to catch use of freed
-	  memory. This can make kmalloc/kfree-intensive workloads much slower.
+	  Say Y here to enable the kernel to detect "hung tasks",
+	  which are bugs that cause the task to be stuck in
+	  uninterruptible "D" state indefinitiley.
 
-config DEBUG_SLAB_LEAK
-	bool "Memory leak debugging"
-	depends on DEBUG_SLAB
+	  When a hung task is detected, the kernel will print the
+	  current stack trace (which you should report), but the
+	  task will stay in uninterruptible state. If lockdep is
+	  enabled then all held locks will also be reported. This
+	  feature has negligible overhead.
 
-config SLUB_DEBUG_ON
-	bool "SLUB debugging on by default"
-	depends on SLUB && SLUB_DEBUG && !KMEMCHECK
-	default n
+config DEFAULT_HUNG_TASK_TIMEOUT
+	int "Default timeout for hung task detection (in seconds)"
+	depends on DETECT_HUNG_TASK
+	default 120
 	help
-	  Boot with debugging on by default. SLUB boots by default with
-	  the runtime debug capabilities switched off. Enabling this is
-	  equivalent to specifying the "slub_debug" parameter on boot.
-	  There is no support for more fine grained debug control like
-	  possible with slub_debug=xxx. SLUB debugging may be switched
-	  off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
-	  "slub_debug=-".
+	  This option controls the default timeout (in seconds) used
+	  to determine when a task has become non-responsive and should
+	  be considered hung.
 
-config SLUB_STATS
-	default n
-	bool "Enable SLUB performance statistics"
-	depends on SLUB && SYSFS
-	help
-	  SLUB statistics are useful to debug SLUBs allocation behavior in
-	  order find ways to optimize the allocator. This should never be
-	  enabled for production use since keeping statistics slows down
-	  the allocator by a few percentage points. The slabinfo command
-	  supports the determination of the most active slabs to figure
-	  out which slabs are relevant to a particular load.
-	  Try running: slabinfo -DA
+	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
+	  sysctl or by writing a value to
+	  /proc/sys/kernel/hung_task_timeout_secs.
 
-config HAVE_DEBUG_KMEMLEAK
-	bool
+	  A timeout of 0 disables the check.  The default is two minutes.
+	  Keeping the default should be fine in most cases.
 
-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
+config BOOTPARAM_HUNG_TASK_PANIC
+	bool "Panic (Reboot) On Hung Tasks"
+	depends on DETECT_HUNG_TASK
 	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/kmemleak.txt for more
-	  details.
+	  Say Y here to enable the kernel to panic on "hung tasks",
+	  which are bugs that cause the kernel to leave a task stuck
+	  in uninterruptible "D" state.
 
-	  Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
-	  of finding leaks due to the slab objects poisoning.
+	  The panic can be used in combination with panic_timeout,
+	  to cause the system to reboot automatically after a
+	  hung task has been detected. This feature is useful for
+	  high-availability systems that have uptime guarantees and
+	  where a hung tasks must be resolved ASAP.
 
-	  In order to access the kmemleak file, debugfs needs to be
-	  mounted (usually at /sys/kernel/debug).
+	  Say N if unsure.
 
-config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
-	int "Maximum kmemleak early log entries"
-	depends on DEBUG_KMEMLEAK
-	range 200 40000
-	default 400
-	help
-	  Kmemleak must track all the memory allocations to avoid
-	  reporting false positives. Since memory may be allocated or
-	  freed before kmemleak is initialised, an early log buffer is
-	  used to store these actions. If kmemleak reports "early log
-	  buffer exceeded", please increase this value.
+config BOOTPARAM_HUNG_TASK_PANIC_VALUE
+	int
+	depends on DETECT_HUNG_TASK
+	range 0 1
+	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
+	default 1 if BOOTPARAM_HUNG_TASK_PANIC
 
-config DEBUG_KMEMLEAK_TEST
-	tristate "Simple test for the kernel memory leak detector"
-	depends on DEBUG_KMEMLEAK && m
+config SCHED_DEBUG
+	bool "Collect scheduler debugging info"
+	depends on DEBUG_KERNEL && PROC_FS
+	default y
 	help
-	  This option enables a module that explicitly leaks memory.
+	  If you say Y here, the /proc/sched_debug file will be provided
+	  that can help debug the scheduler. The runtime overhead of this
+	  option is minimal.
 
-	  If unsure, say N.
+config SCHEDSTATS
+	bool "Collect scheduler statistics"
+	depends on DEBUG_KERNEL && PROC_FS
+	help
+	  If you say Y here, additional code will be inserted into the
+	  scheduler and related routines to collect statistics about
+	  scheduler behavior and provide them in /proc/schedstat.  These
+	  stats may be useful for both tuning and debugging the scheduler
+	  If you aren't debugging the scheduler or trying to tune a specific
+	  application, you can say N to avoid the very slight overhead
+	  this adds.
 
-config DEBUG_KMEMLEAK_DEFAULT_OFF
-	bool "Default kmemleak to off"
-	depends on DEBUG_KMEMLEAK
+config TIMER_STATS
+	bool "Collect kernel timers statistics"
+	depends on DEBUG_KERNEL && PROC_FS
 	help
-	  Say Y here to disable kmemleak by default. It can then be enabled
-	  on the command line via kmemleak=on.
+	  If you say Y here, additional code will be inserted into the
+	  timer routines to collect statistics about kernel timers being
+	  reprogrammed. The statistics can be read from /proc/timer_stats.
+	  The statistics collection is started by writing 1 to /proc/timer_stats,
+	  writing 0 stops it. This feature is useful to collect information
+	  about timer usage patterns in kernel and userspace. This feature
+	  is lightweight if enabled in the kernel config but not activated
+	  (it defaults to deactivated on bootup and will only be activated
+	  if some application like powertop activates it explicitly).
 
 config DEBUG_PREEMPT
 	bool "Debug preemptible kernel"
@@ -672,15 +797,6 @@ config STACKTRACE
 	bool
 	depends on STACKTRACE_SUPPORT
 
-config DEBUG_STACK_USAGE
-	bool "Stack utilization instrumentation"
-	depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
-	help
-	  Enables the display of the minimum amount of free stack which each
-	  task has ever had available in the sysrq-T and sysrq-P debug output.
-
-	  This option will slow down process creation somewhat.
-
 config DEBUG_KOBJECT
 	bool "kobject debugging"
 	depends on DEBUG_KERNEL
@@ -688,13 +804,6 @@ config DEBUG_KOBJECT
 	  If you say Y here, some extra kobject debugging messages will be sent
 	  to the syslog. 
 
-config DEBUG_HIGHMEM
-	bool "Highmem debugging"
-	depends on DEBUG_KERNEL && HIGHMEM
-	help
-	  This options enables addition error checking for high memory systems.
-	  Disable for production systems.
-
 config HAVE_DEBUG_BUGVERBOSE
 	bool
 
@@ -733,40 +842,6 @@ config DEBUG_INFO_REDUCED
 	  DEBUG_INFO build and compile times are reduced too.
 	  Only works with newer gcc versions.
 
-config DEBUG_VM
-	bool "Debug VM"
-	depends on DEBUG_KERNEL
-	help
-	  Enable this to turn on extended checks in the virtual-memory system
-          that may impact performance.
-
-	  If unsure, say N.
-
-config DEBUG_VM_RB
-	bool "Debug VM red-black trees"
-	depends on DEBUG_VM
-	help
-	  Enable this to turn on more extended checks in the virtual-memory
-	  system that may impact performance.
-
-	  If unsure, say N.
-
-config DEBUG_VIRTUAL
-	bool "Debug VM translations"
-	depends on DEBUG_KERNEL && X86
-	help
-	  Enable some costly sanity checks in virtual to page code. This can
-	  catch mistakes with virt_to_page() and friends.
-
-	  If unsure, say N.
-
-config DEBUG_NOMMU_REGIONS
-	bool "Debug the global anon/private NOMMU mapping region tree"
-	depends on DEBUG_KERNEL && !MMU
-	help
-	  This option causes the global tree of anonymous and private mapping
-	  regions to be regularly checked for invalid topology.
-
 config DEBUG_WRITECOUNT
 	bool "Debug filesystem writers count"
 	depends on DEBUG_KERNEL
@@ -777,18 +852,6 @@ config DEBUG_WRITECOUNT
 
 	  If unsure, say N.
 
-config DEBUG_MEMORY_INIT
-	bool "Debug memory initialisation" if EXPERT
-	default !EXPERT
-	help
-	  Enable this for additional checks during memory initialisation.
-	  The sanity checks verify aspects of the VM such as the memory model
-	  and other information provided by the architecture. Verbose
-	  information will be printed at KERN_DEBUG loglevel depending
-	  on the mminit_loglevel= command-line option.
-
-	  If unsure, say Y
-
 config DEBUG_LIST
 	bool "Debug linked list manipulation"
 	depends on DEBUG_KERNEL
@@ -1088,17 +1151,6 @@ config DEBUG_FORCE_WEAK_PER_CPU
 	  To ensure that generic code follows the above rules, this
 	  option forces all percpu variables to be defined as weak.
 
-config DEBUG_PER_CPU_MAPS
-	bool "Debug access to per_cpu maps"
-	depends on DEBUG_KERNEL
-	depends on SMP
-	help
-	  Say Y to verify that the per_cpu map being accessed has
-	  been set up. This adds a fair amount of code to kernel memory
-	  and decreases performance.
-
-	  Say N if unsure.
-
 config LKDTM
 	tristate "Linux Kernel Dump Test Tool Module"
 	depends on DEBUG_FS
@@ -1173,29 +1225,6 @@ config PM_NOTIFIER_ERROR_INJECT
 
 	  If unsure, say N.
 
-config MEMORY_NOTIFIER_ERROR_INJECT
-	tristate "Memory hotplug notifier error injection module"
-	depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
-	help
-	  This option provides the ability to inject artificial errors to
-	  memory hotplug notifier chain callbacks.  It is controlled through
-	  debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
-
-	  If the notifier call chain should be failed with some events
-	  notified, write the error code to "actions/<notifier event>/error".
-
-	  Example: Inject memory hotplug offline error (-12 == -ENOMEM)
-
-	  # cd /sys/kernel/debug/notifier-error-inject/memory
-	  # echo -12 > actions/MEM_GOING_OFFLINE/error
-	  # echo offline > /sys/devices/system/memory/memoryXXX/state
-	  bash: echo: write error: Cannot allocate memory
-
-	  To compile this code as a module, choose M here: the module will
-	  be called memory-notifier-error-inject.
-
-	  If unsure, say N.
-
 config OF_RECONFIG_NOTIFIER_ERROR_INJECT
 	tristate "OF reconfig notifier error injection module"
 	depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
@@ -1310,7 +1339,6 @@ config DEBUG_STRICT_USER_COPY_CHECKS
 
 	  If unsure, say N.
 
-source mm/Kconfig.debug
 source kernel/trace/Kconfig
 
 config RBTREE_TEST
@@ -1475,33 +1503,10 @@ config ASYNC_RAID6_TEST
 
 	  If unsure, say N.
 
-config HAVE_DEBUG_STACKOVERFLOW
-	bool
-
-config DEBUG_STACKOVERFLOW
-	bool "Check for stack overflows"
-	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
-	---help---
-	  Say Y here if you want to check for overflows of kernel, IRQ
-	  and exception stacks (if your archicture uses them). This
-	  option will show detailed messages if free stack space drops
-	  below a certain limit.
-
-	  These kinds of bugs usually occur when call-chains in the
-	  kernel get too deep, especially when interrupts are
-	  involved.
-
-	  Use this in cases where you see apparently random memory
-	  corruption, especially if it appears in 'struct thread_info'
-
-	  If in doubt, say "N".
-
 source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"
 
-source "lib/Kconfig.kmemcheck"
-
 config TEST_STRING_HELPERS
 	tristate "Test functions located in the string_helpers module at runtime"
 
_

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

* [PATCH 3/7] consolidate runtime testing configs
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
  2013-07-01 20:04 ` [PATCH 1/7] consolidate per-arch stack overflow debugging options Dave Hansen
  2013-07-01 20:04 ` [PATCH 2/7] order memory debugging Kconfig options Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  2013-07-01 20:04 ` [PATCH 4/7] consolidate compilation option configs Dave Hansen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave@linux.vnet.ibm.com>
Original posting:

	http://lkml.kernel.org/r/20121214184206.FC11422F@kernel.stglabs.ibm.com

These runtime tests are great, except that there are a lot of them,
and they are very rarely needed.  Give them their own menu so that
only the folks who need them will have to go looking for them.

Note that there are some other runtime tests that are not in here,
like for RCU or locking.  This menu should only be used for tests
that do not have a more appropriate home.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/lib/Kconfig.debug |  157 ++++++++++++++++++-----------------
 1 file changed, 81 insertions(+), 76 deletions(-)

diff -puN lib/Kconfig.debug~consolidat-runtime-testing-configs lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~consolidat-runtime-testing-configs	2013-07-01 12:53:21.002508983 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:21.006509160 -0700
@@ -861,15 +861,6 @@ config DEBUG_LIST
 
 	  If unsure, say N.
 
-config TEST_LIST_SORT
-	bool "Linked list sorting test"
-	depends on DEBUG_KERNEL
-	help
-	  Enable this to turn on 'list_sort()' function test. This test is
-	  executed only once during system boot, so affects only boot time.
-
-	  If unsure, say N.
-
 config DEBUG_SG
 	bool "Debug SG table operations"
 	depends on DEBUG_KERNEL
@@ -1082,33 +1073,6 @@ config RCU_TRACE
 
 endmenu # "RCU Debugging"
 
-config KPROBES_SANITY_TEST
-	bool "Kprobes sanity tests"
-	depends on DEBUG_KERNEL
-	depends on KPROBES
-	default n
-	help
-	  This option provides for testing basic kprobes functionality on
-	  boot. A sample kprobe, jprobe and kretprobe are inserted and
-	  verified for functionality.
-
-	  Say N if you are unsure.
-
-config BACKTRACE_SELF_TEST
-	tristate "Self test for the backtrace code"
-	depends on DEBUG_KERNEL
-	default n
-	help
-	  This option provides a kernel module that can be used to test
-	  the kernel stack backtrace code. This option is not useful
-	  for distributions or general kernels, but only for kernel
-	  developers working on architecture code.
-
-	  Note that if you want to also test saved backtraces, you will
-	  have to enable STACKTRACE as well.
-
-	  Say N if you are unsure.
-
 config DEBUG_BLOCK_EXT_DEVT
         bool "Force extended block device numbers and spread them"
 	depends on DEBUG_KERNEL
@@ -1151,21 +1115,6 @@ config DEBUG_FORCE_WEAK_PER_CPU
 	  To ensure that generic code follows the above rules, this
 	  option forces all percpu variables to be defined as weak.
 
-config LKDTM
-	tristate "Linux Kernel Dump Test Tool Module"
-	depends on DEBUG_FS
-	depends on BLOCK
-	default n
-	help
-	This module enables testing of the different dumping mechanisms by
-	inducing system failures at predefined crash points.
-	If you don't need it: say N
-	Choose M here to compile this code as a module. The module will be
-	called lkdtm.
-
-	Documentation on how to use the module can be found in
-	Documentation/fault-injection/provoke-crashes.txt
-
 config NOTIFIER_ERROR_INJECTION
 	tristate "Notifier error injection"
 	depends on DEBUG_KERNEL
@@ -1341,6 +1290,59 @@ config DEBUG_STRICT_USER_COPY_CHECKS
 
 source kernel/trace/Kconfig
 
+menu "Runtime Testing"
+
+config LKDTM
+	tristate "Linux Kernel Dump Test Tool Module"
+	depends on DEBUG_FS
+	depends on BLOCK
+	default n
+	help
+	This module enables testing of the different dumping mechanisms by
+	inducing system failures at predefined crash points.
+	If you don't need it: say N
+	Choose M here to compile this code as a module. The module will be
+	called lkdtm.
+
+	Documentation on how to use the module can be found in
+	Documentation/fault-injection/provoke-crashes.txt
+
+config TEST_LIST_SORT
+	bool "Linked list sorting test"
+	depends on DEBUG_KERNEL
+	help
+	  Enable this to turn on 'list_sort()' function test. This test is
+	  executed only once during system boot, so affects only boot time.
+
+	  If unsure, say N.
+
+config KPROBES_SANITY_TEST
+	bool "Kprobes sanity tests"
+	depends on DEBUG_KERNEL
+	depends on KPROBES
+	default n
+	help
+	  This option provides for testing basic kprobes functionality on
+	  boot. A sample kprobe, jprobe and kretprobe are inserted and
+	  verified for functionality.
+
+	  Say N if you are unsure.
+
+config BACKTRACE_SELF_TEST
+	tristate "Self test for the backtrace code"
+	depends on DEBUG_KERNEL
+	default n
+	help
+	  This option provides a kernel module that can be used to test
+	  the kernel stack backtrace code. This option is not useful
+	  for distributions or general kernels, but only for kernel
+	  developers working on architecture code.
+
+	  Note that if you want to also test saved backtraces, you will
+	  have to enable STACKTRACE as well.
+
+	  Say N if you are unsure.
+
 config RBTREE_TEST
 	tristate "Red-Black tree test"
 	depends on m && DEBUG_KERNEL
@@ -1354,6 +1356,34 @@ config INTERVAL_TREE_TEST
 	help
 	  A benchmark measuring the performance of the interval tree library
 
+config ATOMIC64_SELFTEST
+	bool "Perform an atomic64_t self-test at boot"
+	help
+	  Enable this option to test the atomic64_t functions at boot.
+
+	  If unsure, say N.
+
+config ASYNC_RAID6_TEST
+	tristate "Self test for hardware accelerated raid6 recovery"
+	depends on ASYNC_RAID6_RECOV
+	select ASYNC_MEMCPY
+	---help---
+	  This is a one-shot self test that permutes through the
+	  recovery of all the possible two disk failure scenarios for a
+	  N-disk array.  Recovery is performed with the asynchronous
+	  raid6 recovery routines, and will optionally use an offload
+	  engine if one is available.
+
+	  If unsure, say N.
+
+config TEST_STRING_HELPERS
+	tristate "Test functions located in the string_helpers module at runtime"
+
+config TEST_KSTRTOX
+	tristate "Test kstrto*() family of functions at runtime"
+
+endmenu # runtime tests
+
 config PROVIDE_OHCI1394_DMA_INIT
 	bool "Remote debugging over FireWire early on boot"
 	depends on PCI && X86
@@ -1483,32 +1513,7 @@ config DMA_API_DEBUG
 	  This option causes a performance degredation.  Use only if you want
 	  to debug device drivers. If unsure, say N.
 
-config ATOMIC64_SELFTEST
-	bool "Perform an atomic64_t self-test at boot"
-	help
-	  Enable this option to test the atomic64_t functions at boot.
-
-	  If unsure, say N.
-
-config ASYNC_RAID6_TEST
-	tristate "Self test for hardware accelerated raid6 recovery"
-	depends on ASYNC_RAID6_RECOV
-	select ASYNC_MEMCPY
-	---help---
-	  This is a one-shot self test that permutes through the
-	  recovery of all the possible two disk failure scenarios for a
-	  N-disk array.  Recovery is performed with the asynchronous
-	  raid6 recovery routines, and will optionally use an offload
-	  engine if one is available.
-
-	  If unsure, say N.
-
 source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"
 
-config TEST_STRING_HELPERS
-	tristate "Test functions located in the string_helpers module at runtime"
-
-config TEST_KSTRTOX
-	tristate "Test kstrto*() family of functions at runtime"
_

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

* [PATCH 4/7] consolidate compilation option configs
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
                   ` (2 preceding siblings ...)
  2013-07-01 20:04 ` [PATCH 3/7] consolidate runtime testing configs Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  2013-07-01 20:04 ` [PATCH 5/7] group locking debugging options Dave Hansen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave@linux.vnet.ibm.com>

Original Post:

	http://lkml.kernel.org/r/20121214184207.6E00DDEC@kernel.stglabs.ibm.com

Again, trying to come up with some common themes of the stuff in
the kernel hacking menu...  There are quite a few options to
tweak compilation in some way, or perform extra compile-time
checks.  Give them their own menu.

The diff here looks a bit funny... makes it look like I'm
moving debugfs even though I'm actually moving the options on
either side of it.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/lib/Kconfig.debug |  156 +++++++++++++++++------------------
 1 file changed, 80 insertions(+), 76 deletions(-)

diff -puN lib/Kconfig.debug~consolidate-compilation-configs lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~consolidate-compilation-configs	2013-07-01 12:53:21.262520509 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:21.266520686 -0700
@@ -25,6 +25,34 @@ config DEFAULT_MESSAGE_LOGLEVEL
 	  that are auditing their logs closely may want to set it to a lower
 	  priority.
 
+menu "Compile-time checks and compiler options"
+
+config DEBUG_INFO
+	bool "Compile the kernel with debug info"
+	depends on DEBUG_KERNEL
+	help
+          If you say Y here the resulting kernel image will include
+	  debugging info resulting in a larger kernel image.
+	  This adds debug symbols to the kernel and modules (gcc -g), and
+	  is needed if you intend to use kernel crashdump or binary object
+	  tools like crash, kgdb, LKCD, gdb, etc on the kernel.
+	  Say Y here only if you plan to debug the kernel.
+
+	  If unsure, say N.
+
+config DEBUG_INFO_REDUCED
+	bool "Reduce debugging information"
+	depends on DEBUG_INFO
+	help
+	  If you say Y here gcc is instructed to generate less debugging
+	  information for structure types. This means that tools that
+	  need full debugging information (like kgdb or systemtap) won't
+	  be happy. But if you merely need debugging information to
+	  resolve line numbers there is no loss. Advantage is that
+	  build directory object sizes shrink dramatically over a full
+	  DEBUG_INFO build and compile times are reduced too.
+	  Only works with newer gcc versions.
+
 config ENABLE_WARN_DEPRECATED
 	bool "Enable __deprecated logic"
 	default y
@@ -52,20 +80,6 @@ config FRAME_WARN
 	  Setting it to 0 disables the warning.
 	  Requires gcc 4.4
 
-config MAGIC_SYSRQ
-	bool "Magic SysRq key"
-	depends on !UML
-	help
-	  If you say Y here, you will have some control over the system even
-	  if the system crashes for example during kernel debugging (e.g., you
-	  will be able to flush the buffer cache to disk, reboot the system
-	  immediately or dump some status information). This is accomplished
-	  by pressing various keys while holding SysRq (Alt+PrintScreen). It
-	  also works on a serial console (on PC hardware at least), if you
-	  send a BREAK and then within 5 seconds a command keypress. The
-	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
-	  unless you really know what this hack does.
-
 config STRIP_ASM_SYMS
 	bool "Strip assembler-generated symbols during link"
 	default n
@@ -156,6 +170,58 @@ config DEBUG_SECTION_MISMATCH
 	  - Enable verbose reporting from modpost in order to help resolve
 	    the section mismatches that are reported.
 
+#
+# Select this config option from the architecture Kconfig, if it
+# is preferred to always offer frame pointers as a config
+# option on the architecture (regardless of KERNEL_DEBUG):
+#
+config ARCH_WANT_FRAME_POINTERS
+	bool
+	help
+
+config FRAME_POINTER
+	bool "Compile the kernel with frame pointers"
+	depends on DEBUG_KERNEL && \
+		(CRIS || M68K || FRV || UML || \
+		 AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
+		ARCH_WANT_FRAME_POINTERS
+	default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
+	help
+	  If you say Y here the resulting kernel image will be slightly
+	  larger and slower, but it gives very useful debugging information
+	  in case of kernel bugs. (precise oopses/stacktraces/warnings)
+
+config DEBUG_FORCE_WEAK_PER_CPU
+	bool "Force weak per-cpu definitions"
+	depends on DEBUG_KERNEL
+	help
+	  s390 and alpha require percpu variables in modules to be
+	  defined weak to work around addressing range issue which
+	  puts the following two restrictions on percpu variable
+	  definitions.
+
+	  1. percpu symbols must be unique whether static or not
+	  2. percpu variables can't be defined inside a function
+
+	  To ensure that generic code follows the above rules, this
+	  option forces all percpu variables to be defined as weak.
+
+endmenu # "Compiler options"
+
+config MAGIC_SYSRQ
+	bool "Magic SysRq key"
+	depends on !UML
+	help
+	  If you say Y here, you will have some control over the system even
+	  if the system crashes for example during kernel debugging (e.g., you
+	  will be able to flush the buffer cache to disk, reboot the system
+	  immediately or dump some status information). This is accomplished
+	  by pressing various keys while holding SysRq (Alt+PrintScreen). It
+	  also works on a serial console (on PC hardware at least), if you
+	  send a BREAK and then within 5 seconds a command keypress. The
+	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
+	  unless you really know what this hack does.
+
 config DEBUG_KERNEL
 	bool "Kernel debugging"
 	help
@@ -816,32 +882,6 @@ config DEBUG_BUGVERBOSE
 	  of the BUG call as well as the EIP and oops trace.  This aids
 	  debugging but costs about 70-100K of memory.
 
-config DEBUG_INFO
-	bool "Compile the kernel with debug info"
-	depends on DEBUG_KERNEL
-	help
-          If you say Y here the resulting kernel image will include
-	  debugging info resulting in a larger kernel image.
-	  This adds debug symbols to the kernel and modules (gcc -g), and
-	  is needed if you intend to use kernel crashdump or binary object
-	  tools like crash, kgdb, LKCD, gdb, etc on the kernel.
-	  Say Y here only if you plan to debug the kernel.
-
-	  If unsure, say N.
-
-config DEBUG_INFO_REDUCED
-	bool "Reduce debugging information"
-	depends on DEBUG_INFO
-	help
-	  If you say Y here gcc is instructed to generate less debugging
-	  information for structure types. This means that tools that
-	  need full debugging information (like kgdb or systemtap) won't
-	  be happy. But if you merely need debugging information to
-	  resolve line numbers there is no loss. Advantage is that
-	  build directory object sizes shrink dramatically over a full
-	  DEBUG_INFO build and compile times are reduced too.
-	  Only works with newer gcc versions.
-
 config DEBUG_WRITECOUNT
 	bool "Debug filesystem writers count"
 	depends on DEBUG_KERNEL
@@ -896,27 +936,6 @@ config DEBUG_CREDENTIALS
 
 	  If unsure, say N.
 
-#
-# Select this config option from the architecture Kconfig, if it
-# is preferred to always offer frame pointers as a config
-# option on the architecture (regardless of KERNEL_DEBUG):
-#
-config ARCH_WANT_FRAME_POINTERS
-	bool
-	help
-
-config FRAME_POINTER
-	bool "Compile the kernel with frame pointers"
-	depends on DEBUG_KERNEL && \
-		(CRIS || M68K || FRV || UML || \
-		 AVR32 || SUPERH || BLACKFIN || MN10300 || METAG) || \
-		ARCH_WANT_FRAME_POINTERS
-	default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
-	help
-	  If you say Y here the resulting kernel image will be slightly
-	  larger and slower, but it gives very useful debugging information
-	  in case of kernel bugs. (precise oopses/stacktraces/warnings)
-
 config BOOT_PRINTK_DELAY
 	bool "Delay each boot printk message by N milliseconds"
 	depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
@@ -1100,21 +1119,6 @@ config DEBUG_BLOCK_EXT_DEVT
 
 	  Say N if you are unsure.
 
-config DEBUG_FORCE_WEAK_PER_CPU
-	bool "Force weak per-cpu definitions"
-	depends on DEBUG_KERNEL
-	help
-	  s390 and alpha require percpu variables in modules to be
-	  defined weak to work around addressing range issue which
-	  puts the following two restrictions on percpu variable
-	  definitions.
-
-	  1. percpu symbols must be unique whether static or not
-	  2. percpu variables can't be defined inside a function
-
-	  To ensure that generic code follows the above rules, this
-	  option forces all percpu variables to be defined as weak.
-
 config NOTIFIER_ERROR_INJECTION
 	tristate "Notifier error injection"
 	depends on DEBUG_KERNEL
_

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

* [PATCH 5/7] group locking debugging options
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
                   ` (3 preceding siblings ...)
  2013-07-01 20:04 ` [PATCH 4/7] consolidate compilation option configs Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  2013-07-01 20:04 ` [PATCH 6/7] kconfig: consolidate printk options Dave Hansen
  2013-07-01 20:04 ` [PATCH 7/7] hang and lockup detection menu Dave Hansen
  6 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave@linux.vnet.ibm.com>

Original posting:

	http://lkml.kernel.org/r/20121214184208.D9E5804D@kernel.stglabs.ibm.com

There are quite a few of these, and we want to make sure that
there is one-stop-shopping for lock debugging.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/lib/Kconfig.debug |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff -puN lib/Kconfig.debug~order-lock-debugging-options lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~order-lock-debugging-options	2013-07-01 12:53:21.523532080 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:21.526532213 -0700
@@ -703,6 +703,8 @@ config DEBUG_PREEMPT
 	  if kernel code uses it in a preemption-unsafe way. Also, the kernel
 	  will detect preemption count underflows.
 
+menu "Lock Debugging (spinlocks, mutexes, etc...)"
+
 config DEBUG_RT_MUTEXES
 	bool "RT Mutex debugging, deadlock detection"
 	depends on DEBUG_KERNEL && RT_MUTEXES
@@ -832,12 +834,6 @@ config DEBUG_LOCKDEP
 	  additional runtime checks to debug itself, at the price
 	  of more runtime overhead.
 
-config TRACE_IRQFLAGS
-	bool
-	help
-	  Enables hooks to interrupt enabling and disabling for
-	  either tracing or lock debugging.
-
 config DEBUG_ATOMIC_SLEEP
 	bool "Sleep inside atomic section checking"
 	select PREEMPT_COUNT
@@ -859,6 +855,14 @@ config DEBUG_LOCKING_API_SELFTESTS
 	  The following locking APIs are covered: spinlocks, rwlocks,
 	  mutexes and rwsems.
 
+endmenu # lock debugging
+
+config TRACE_IRQFLAGS
+	bool
+	help
+	  Enables hooks to interrupt enabling and disabling for
+	  either tracing or lock debugging.
+
 config STACKTRACE
 	bool
 	depends on STACKTRACE_SUPPORT
_

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

* [PATCH 6/7] kconfig: consolidate printk options
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
                   ` (4 preceding siblings ...)
  2013-07-01 20:04 ` [PATCH 5/7] group locking debugging options Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  2013-07-01 20:04 ` [PATCH 7/7] hang and lockup detection menu Dave Hansen
  6 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave.hansen@linux.intel.com>

Same deal, take the printk-related things and hide them in a menu.
This takes another 4 items out of the top-level menu.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/lib/Kconfig.debug |  177 +++++++++++++++++------------------
 1 file changed, 90 insertions(+), 87 deletions(-)

diff -puN lib/Kconfig.debug~printk-options lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~printk-options	2013-07-01 12:53:21.781543517 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:21.785543695 -0700
@@ -1,3 +1,4 @@
+menu "printk and dmesg options"
 
 config PRINTK_TIME
 	bool "Show timing information on printks"
@@ -25,6 +26,95 @@ config DEFAULT_MESSAGE_LOGLEVEL
 	  that are auditing their logs closely may want to set it to a lower
 	  priority.
 
+config BOOT_PRINTK_DELAY
+	bool "Delay each boot printk message by N milliseconds"
+	depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
+	help
+	  This build option allows you to read kernel boot messages
+	  by inserting a short delay after each one.  The delay is
+	  specified in milliseconds on the kernel command line,
+	  using "boot_delay=N".
+
+	  It is likely that you would also need to use "lpj=M" to preset
+	  the "loops per jiffie" value.
+	  See a previous boot log for the "lpj" value to use for your
+	  system, and then set "lpj=M" before setting "boot_delay=N".
+	  NOTE:  Using this option may adversely affect SMP systems.
+	  I.e., processors other than the first one may not boot up.
+	  BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
+	  what it believes to be lockup conditions.
+
+config DYNAMIC_DEBUG
+	bool "Enable dynamic printk() support"
+	default n
+	depends on PRINTK
+	depends on DEBUG_FS
+	help
+
+	  Compiles debug level messages into the kernel, which would not
+	  otherwise be available at runtime. These messages can then be
+	  enabled/disabled based on various levels of scope - per source file,
+	  function, module, format string, and line number. This mechanism
+	  implicitly compiles in all pr_debug() and dev_dbg() calls, which
+	  enlarges the kernel text size by about 2%.
+
+	  If a source file is compiled with DEBUG flag set, any
+	  pr_debug() calls in it are enabled by default, but can be
+	  disabled at runtime as below.  Note that DEBUG flag is
+	  turned on by many CONFIG_*DEBUG* options.
+
+	  Usage:
+
+	  Dynamic debugging is controlled via the 'dynamic_debug/control' file,
+	  which is contained in the 'debugfs' filesystem. Thus, the debugfs
+	  filesystem must first be mounted before making use of this feature.
+	  We refer the control file as: <debugfs>/dynamic_debug/control. This
+	  file contains a list of the debug statements that can be enabled. The
+	  format for each line of the file is:
+
+		filename:lineno [module]function flags format
+
+	  filename : source file of the debug statement
+	  lineno : line number of the debug statement
+	  module : module that contains the debug statement
+	  function : function that contains the debug statement
+          flags : '=p' means the line is turned 'on' for printing
+          format : the format used for the debug statement
+
+	  From a live system:
+
+		nullarbor:~ # cat <debugfs>/dynamic_debug/control
+		# filename:lineno [module]function flags format
+		fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
+		fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
+		fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
+
+	  Example usage:
+
+		// enable the message at line 1603 of file svcsock.c
+		nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
+						<debugfs>/dynamic_debug/control
+
+		// enable all the messages in file svcsock.c
+		nullarbor:~ # echo -n 'file svcsock.c +p' >
+						<debugfs>/dynamic_debug/control
+
+		// enable all the messages in the NFS server module
+		nullarbor:~ # echo -n 'module nfsd +p' >
+						<debugfs>/dynamic_debug/control
+
+		// enable all 12 messages in the function svc_process()
+		nullarbor:~ # echo -n 'func svc_process +p' >
+						<debugfs>/dynamic_debug/control
+
+		// disable all 12 messages in the function svc_process()
+		nullarbor:~ # echo -n 'func svc_process -p' >
+						<debugfs>/dynamic_debug/control
+
+	  See Documentation/dynamic-debug-howto.txt for additional information.
+
+endmenu # "printk and dmesg options"
+
 menu "Compile-time checks and compiler options"
 
 config DEBUG_INFO
@@ -940,24 +1030,6 @@ config DEBUG_CREDENTIALS
 
 	  If unsure, say N.
 
-config BOOT_PRINTK_DELAY
-	bool "Delay each boot printk message by N milliseconds"
-	depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
-	help
-	  This build option allows you to read kernel boot messages
-	  by inserting a short delay after each one.  The delay is
-	  specified in milliseconds on the kernel command line,
-	  using "boot_delay=N".
-
-	  It is likely that you would also need to use "lpj=M" to preset
-	  the "loops per jiffie" value.
-	  See a previous boot log for the "lpj" value to use for your
-	  system, and then set "lpj=M" before setting "boot_delay=N".
-	  NOTE:  Using this option may adversely affect SMP systems.
-	  I.e., processors other than the first one may not boot up.
-	  BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
-	  what it believes to be lockup conditions.
-
 menu "RCU Debugging"
 
 config PROVE_RCU
@@ -1441,75 +1513,6 @@ config BUILD_DOCSRC
 
 	  Say N if you are unsure.
 
-config DYNAMIC_DEBUG
-	bool "Enable dynamic printk() support"
-	default n
-	depends on PRINTK
-	depends on DEBUG_FS
-	help
-
-	  Compiles debug level messages into the kernel, which would not
-	  otherwise be available at runtime. These messages can then be
-	  enabled/disabled based on various levels of scope - per source file,
-	  function, module, format string, and line number. This mechanism
-	  implicitly compiles in all pr_debug() and dev_dbg() calls, which
-	  enlarges the kernel text size by about 2%.
-
-	  If a source file is compiled with DEBUG flag set, any
-	  pr_debug() calls in it are enabled by default, but can be
-	  disabled at runtime as below.  Note that DEBUG flag is
-	  turned on by many CONFIG_*DEBUG* options.
-
-	  Usage:
-
-	  Dynamic debugging is controlled via the 'dynamic_debug/control' file,
-	  which is contained in the 'debugfs' filesystem. Thus, the debugfs
-	  filesystem must first be mounted before making use of this feature.
-	  We refer the control file as: <debugfs>/dynamic_debug/control. This
-	  file contains a list of the debug statements that can be enabled. The
-	  format for each line of the file is:
-
-		filename:lineno [module]function flags format
-
-	  filename : source file of the debug statement
-	  lineno : line number of the debug statement
-	  module : module that contains the debug statement
-	  function : function that contains the debug statement
-          flags : '=p' means the line is turned 'on' for printing
-          format : the format used for the debug statement
-
-	  From a live system:
-
-		nullarbor:~ # cat <debugfs>/dynamic_debug/control
-		# filename:lineno [module]function flags format
-		fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
-		fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
-		fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
-
-	  Example usage:
-
-		// enable the message at line 1603 of file svcsock.c
-		nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
-						<debugfs>/dynamic_debug/control
-
-		// enable all the messages in file svcsock.c
-		nullarbor:~ # echo -n 'file svcsock.c +p' >
-						<debugfs>/dynamic_debug/control
-
-		// enable all the messages in the NFS server module
-		nullarbor:~ # echo -n 'module nfsd +p' >
-						<debugfs>/dynamic_debug/control
-
-		// enable all 12 messages in the function svc_process()
-		nullarbor:~ # echo -n 'func svc_process +p' >
-						<debugfs>/dynamic_debug/control
-
-		// disable all 12 messages in the function svc_process()
-		nullarbor:~ # echo -n 'func svc_process -p' >
-						<debugfs>/dynamic_debug/control
-
-	  See Documentation/dynamic-debug-howto.txt for additional information.
-
 config DMA_API_DEBUG
 	bool "Enable debugging of DMA-API usage"
 	depends on HAVE_DMA_API_DEBUG
_

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

* [PATCH 7/7] hang and lockup detection menu
  2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
                   ` (5 preceding siblings ...)
  2013-07-01 20:04 ` [PATCH 6/7] kconfig: consolidate printk options Dave Hansen
@ 2013-07-01 20:04 ` Dave Hansen
  6 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2013-07-01 20:04 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, Dave Hansen


From: Dave Hansen <dave.hansen@linux.intel.com>

The hard/softlockup and hung-task entries take up 6 lines
of screen real-estate when enabled.  I bet folks don't
mess with these _that_ often, so move them in a group
down a level.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 linux.git-davehans/lib/Kconfig.debug |   42 +++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 19 deletions(-)

diff -puN lib/Kconfig.debug~lockup-detection lib/Kconfig.debug
--- linux.git/lib/Kconfig.debug~lockup-detection	2013-07-01 12:53:22.040554999 -0700
+++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:22.044555177 -0700
@@ -604,6 +604,8 @@ config DEBUG_SHIRQ
 	  Drivers ought to be able to handle interrupts coming in at those
 	  points; some don't and need to be caught.
 
+menu "Debug Lockups and Hangs"
+
 config LOCKUP_DETECTOR
 	bool "Detect Hard and Soft Lockups"
 	depends on DEBUG_KERNEL && !S390
@@ -675,25 +677,6 @@ config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
 	default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
 	default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
 
-config PANIC_ON_OOPS
-	bool "Panic on Oops"
-	help
-	  Say Y here to enable the kernel to panic when it oopses. This
-	  has the same effect as setting oops=panic on the kernel command
-	  line.
-
-	  This feature is useful to ensure that the kernel does not do
-	  anything erroneous after an oops which could result in data
-	  corruption or other issues.
-
-	  Say N if unsure.
-
-config PANIC_ON_OOPS_VALUE
-	int
-	range 0 1
-	default 0 if !PANIC_ON_OOPS
-	default 1 if PANIC_ON_OOPS
-
 config DETECT_HUNG_TASK
 	bool "Detect Hung Tasks"
 	depends on DEBUG_KERNEL
@@ -748,6 +731,27 @@ config BOOTPARAM_HUNG_TASK_PANIC_VALUE
 	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
 	default 1 if BOOTPARAM_HUNG_TASK_PANIC
 
+endmenu # "Debug lockups and hangs"
+
+config PANIC_ON_OOPS
+	bool "Panic on Oops"
+	help
+	  Say Y here to enable the kernel to panic when it oopses. This
+	  has the same effect as setting oops=panic on the kernel command
+	  line.
+
+	  This feature is useful to ensure that the kernel does not do
+	  anything erroneous after an oops which could result in data
+	  corruption or other issues.
+
+	  Say N if unsure.
+
+config PANIC_ON_OOPS_VALUE
+	int
+	range 0 1
+	default 0 if !PANIC_ON_OOPS
+	default 1 if PANIC_ON_OOPS
+
 config SCHED_DEBUG
 	bool "Collect scheduler debugging info"
 	depends on DEBUG_KERNEL && PROC_FS
_

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

* Re: [PATCH 2/7] order memory debugging Kconfig options
  2013-07-01 20:04 ` [PATCH 2/7] order memory debugging Kconfig options Dave Hansen
@ 2013-07-08 16:43   ` Paul E. McKenney
  0 siblings, 0 replies; 13+ messages in thread
From: Paul E. McKenney @ 2013-07-08 16:43 UTC (permalink / raw)
  To: Dave Hansen; +Cc: torvalds, linux-kernel

On Mon, Jul 01, 2013 at 01:04:43PM -0700, Dave Hansen wrote:
> 
> From: Dave Hansen <dave@linux.vnet.ibm.com>
> 
> Original posting:
> 
> 	http://lkml.kernel.org/r/20121214184203.37E6C724@kernel.stglabs.ibm.com
> 
> There are a *LOT* of memory debugging options.  They are just scattered
> all over the "Kernel Hacking" menu.  Sure, "memory debugging" is a very
> vague term and it's going to be hard to make absolute rules about what
> goes in here, but this has to be better than what we had before.
> 
> This does, however, leave out the architecture-specific memory
> debugging options (like x86's DEBUG_SET_MODULE_RONX).  There would need
> to be some substantial changes to move those in here.  Kconfig can not
> easily mix arch-specific and generic options together: it really
> requires a file per-architecture, and I think having an
> arch/foo/Kconfig.debug-memory might be taking things a bit too far
> 
> Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>

For the RCU-related options:

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> ---
> 
>  linux.git-davehans/lib/Kconfig.debug |  685 +++++++++++++++++------------------
>  1 file changed, 345 insertions(+), 340 deletions(-)
> 
> diff -puN lib/Kconfig.debug~order-memory-debugging-options lib/Kconfig.debug
> --- linux.git/lib/Kconfig.debug~order-memory-debugging-options	2013-07-01 12:53:20.740497368 -0700
> +++ linux.git-davehans/lib/Kconfig.debug	2013-07-01 12:53:20.745497590 -0700
> @@ -162,6 +162,283 @@ config DEBUG_KERNEL
>  	  Say Y here if you are developing drivers or trying to debug and
>  	  identify kernel problems.
> 
> +menu "Memory Debugging"
> +
> +source mm/Kconfig.debug
> +
> +config DEBUG_OBJECTS
> +	bool "Debug object operations"
> +	depends on DEBUG_KERNEL
> +	help
> +	  If you say Y here, additional code will be inserted into the
> +	  kernel to track the life time of various objects and validate
> +	  the operations on those objects.
> +
> +config DEBUG_OBJECTS_SELFTEST
> +	bool "Debug objects selftest"
> +	depends on DEBUG_OBJECTS
> +	help
> +	  This enables the selftest of the object debug code.
> +
> +config DEBUG_OBJECTS_FREE
> +	bool "Debug objects in freed memory"
> +	depends on DEBUG_OBJECTS
> +	help
> +	  This enables checks whether a k/v free operation frees an area
> +	  which contains an object which has not been deactivated
> +	  properly. This can make kmalloc/kfree-intensive workloads
> +	  much slower.
> +
> +config DEBUG_OBJECTS_TIMERS
> +	bool "Debug timer objects"
> +	depends on DEBUG_OBJECTS
> +	help
> +	  If you say Y here, additional code will be inserted into the
> +	  timer routines to track the life time of timer objects and
> +	  validate the timer operations.
> +
> +config DEBUG_OBJECTS_WORK
> +	bool "Debug work objects"
> +	depends on DEBUG_OBJECTS
> +	help
> +	  If you say Y here, additional code will be inserted into the
> +	  work queue routines to track the life time of work objects and
> +	  validate the work operations.
> +
> +config DEBUG_OBJECTS_RCU_HEAD
> +	bool "Debug RCU callbacks objects"
> +	depends on DEBUG_OBJECTS
> +	help
> +	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
> +
> +config DEBUG_OBJECTS_PERCPU_COUNTER
> +	bool "Debug percpu counter objects"
> +	depends on DEBUG_OBJECTS
> +	help
> +	  If you say Y here, additional code will be inserted into the
> +	  percpu counter routines to track the life time of percpu counter
> +	  objects and validate the percpu counter operations.
> +
> +config DEBUG_OBJECTS_ENABLE_DEFAULT
> +	int "debug_objects bootup default value (0-1)"
> +        range 0 1
> +        default "1"
> +        depends on DEBUG_OBJECTS
> +        help
> +          Debug objects boot parameter default value
> +
> +config DEBUG_SLAB
> +	bool "Debug slab memory allocations"
> +	depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
> +	help
> +	  Say Y here to have the kernel do limited verification on memory
> +	  allocation as well as poisoning memory on free to catch use of freed
> +	  memory. This can make kmalloc/kfree-intensive workloads much slower.
> +
> +config DEBUG_SLAB_LEAK
> +	bool "Memory leak debugging"
> +	depends on DEBUG_SLAB
> +
> +config SLUB_DEBUG_ON
> +	bool "SLUB debugging on by default"
> +	depends on SLUB && SLUB_DEBUG && !KMEMCHECK
> +	default n
> +	help
> +	  Boot with debugging on by default. SLUB boots by default with
> +	  the runtime debug capabilities switched off. Enabling this is
> +	  equivalent to specifying the "slub_debug" parameter on boot.
> +	  There is no support for more fine grained debug control like
> +	  possible with slub_debug=xxx. SLUB debugging may be switched
> +	  off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
> +	  "slub_debug=-".
> +
> +config SLUB_STATS
> +	default n
> +	bool "Enable SLUB performance statistics"
> +	depends on SLUB && SYSFS
> +	help
> +	  SLUB statistics are useful to debug SLUBs allocation behavior in
> +	  order find ways to optimize the allocator. This should never be
> +	  enabled for production use since keeping statistics slows down
> +	  the allocator by a few percentage points. The slabinfo command
> +	  supports the determination of the most active slabs to figure
> +	  out which slabs are relevant to a particular load.
> +	  Try running: slabinfo -DA
> +
> +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
> +	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/kmemleak.txt 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_EARLY_LOG_SIZE
> +	int "Maximum kmemleak early log entries"
> +	depends on DEBUG_KMEMLEAK
> +	range 200 40000
> +	default 400
> +	help
> +	  Kmemleak must track all the memory allocations to avoid
> +	  reporting false positives. Since memory may be allocated or
> +	  freed before kmemleak is initialised, an early log buffer is
> +	  used to store these actions. If kmemleak reports "early log
> +	  buffer exceeded", please increase this value.
> +
> +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_STACK_USAGE
> +	bool "Stack utilization instrumentation"
> +	depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
> +	help
> +	  Enables the display of the minimum amount of free stack which each
> +	  task has ever had available in the sysrq-T and sysrq-P debug output.
> +
> +	  This option will slow down process creation somewhat.
> +
> +config DEBUG_VM
> +	bool "Debug VM"
> +	depends on DEBUG_KERNEL
> +	help
> +	  Enable this to turn on extended checks in the virtual-memory system
> +          that may impact performance.
> +
> +	  If unsure, say N.
> +
> +config DEBUG_VM_RB
> +	bool "Debug VM red-black trees"
> +	depends on DEBUG_VM
> +	help
> +	  Enable this to turn on more extended checks in the virtual-memory
> +	  system that may impact performance.
> +
> +	  If unsure, say N.
> +
> +config DEBUG_VIRTUAL
> +	bool "Debug VM translations"
> +	depends on DEBUG_KERNEL && X86
> +	help
> +	  Enable some costly sanity checks in virtual to page code. This can
> +	  catch mistakes with virt_to_page() and friends.
> +
> +	  If unsure, say N.
> +
> +config DEBUG_NOMMU_REGIONS
> +	bool "Debug the global anon/private NOMMU mapping region tree"
> +	depends on DEBUG_KERNEL && !MMU
> +	help
> +	  This option causes the global tree of anonymous and private mapping
> +	  regions to be regularly checked for invalid topology.
> +
> +config DEBUG_MEMORY_INIT
> +	bool "Debug memory initialisation" if EXPERT
> +	default !EXPERT
> +	help
> +	  Enable this for additional checks during memory initialisation.
> +	  The sanity checks verify aspects of the VM such as the memory model
> +	  and other information provided by the architecture. Verbose
> +	  information will be printed at KERN_DEBUG loglevel depending
> +	  on the mminit_loglevel= command-line option.
> +
> +	  If unsure, say Y
> +
> +config MEMORY_NOTIFIER_ERROR_INJECT
> +	tristate "Memory hotplug notifier error injection module"
> +	depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
> +	help
> +	  This option provides the ability to inject artificial errors to
> +	  memory hotplug notifier chain callbacks.  It is controlled through
> +	  debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
> +
> +	  If the notifier call chain should be failed with some events
> +	  notified, write the error code to "actions/<notifier event>/error".
> +
> +	  Example: Inject memory hotplug offline error (-12 == -ENOMEM)
> +
> +	  # cd /sys/kernel/debug/notifier-error-inject/memory
> +	  # echo -12 > actions/MEM_GOING_OFFLINE/error
> +	  # echo offline > /sys/devices/system/memory/memoryXXX/state
> +	  bash: echo: write error: Cannot allocate memory
> +
> +	  To compile this code as a module, choose M here: the module will
> +	  be called memory-notifier-error-inject.
> +
> +	  If unsure, say N.
> +
> +config DEBUG_PER_CPU_MAPS
> +	bool "Debug access to per_cpu maps"
> +	depends on DEBUG_KERNEL
> +	depends on SMP
> +	help
> +	  Say Y to verify that the per_cpu map being accessed has
> +	  been set up. This adds a fair amount of code to kernel memory
> +	  and decreases performance.
> +
> +	  Say N if unsure.
> +
> +config DEBUG_HIGHMEM
> +	bool "Highmem debugging"
> +	depends on DEBUG_KERNEL && HIGHMEM
> +	help
> +	  This options enables addition error checking for high memory systems.
> +	  Disable for production systems.
> +
> +config HAVE_DEBUG_STACKOVERFLOW
> +	bool
> +
> +config DEBUG_STACKOVERFLOW
> +	bool "Check for stack overflows"
> +	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
> +	---help---
> +	  Say Y here if you want to check for overflows of kernel, IRQ
> +	  and exception stacks (if your archicture uses them). This
> +	  option will show detailed messages if free stack space drops
> +	  below a certain limit.
> +
> +	  These kinds of bugs usually occur when call-chains in the
> +	  kernel get too deep, especially when interrupts are
> +	  involved.
> +
> +	  Use this in cases where you see apparently random memory
> +	  corruption, especially if it appears in 'struct thread_info'
> +
> +	  If in doubt, say "N".
> +
> +source "lib/Kconfig.kmemcheck"
> +
> +endmenu # "Memory Debugging"
> +
>  config DEBUG_SHIRQ
>  	bool "Debug shared IRQ handlers"
>  	depends on DEBUG_KERNEL && GENERIC_HARDIRQS
> @@ -266,241 +543,89 @@ config DETECT_HUNG_TASK
>  	depends on DEBUG_KERNEL
>  	default LOCKUP_DETECTOR
>  	help
> -	  Say Y here to enable the kernel to detect "hung tasks",
> -	  which are bugs that cause the task to be stuck in
> -	  uninterruptible "D" state indefinitiley.
> -
> -	  When a hung task is detected, the kernel will print the
> -	  current stack trace (which you should report), but the
> -	  task will stay in uninterruptible state. If lockdep is
> -	  enabled then all held locks will also be reported. This
> -	  feature has negligible overhead.
> -
> -config DEFAULT_HUNG_TASK_TIMEOUT
> -	int "Default timeout for hung task detection (in seconds)"
> -	depends on DETECT_HUNG_TASK
> -	default 120
> -	help
> -	  This option controls the default timeout (in seconds) used
> -	  to determine when a task has become non-responsive and should
> -	  be considered hung.
> -
> -	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
> -	  sysctl or by writing a value to
> -	  /proc/sys/kernel/hung_task_timeout_secs.
> -
> -	  A timeout of 0 disables the check.  The default is two minutes.
> -	  Keeping the default should be fine in most cases.
> -
> -config BOOTPARAM_HUNG_TASK_PANIC
> -	bool "Panic (Reboot) On Hung Tasks"
> -	depends on DETECT_HUNG_TASK
> -	help
> -	  Say Y here to enable the kernel to panic on "hung tasks",
> -	  which are bugs that cause the kernel to leave a task stuck
> -	  in uninterruptible "D" state.
> -
> -	  The panic can be used in combination with panic_timeout,
> -	  to cause the system to reboot automatically after a
> -	  hung task has been detected. This feature is useful for
> -	  high-availability systems that have uptime guarantees and
> -	  where a hung tasks must be resolved ASAP.
> -
> -	  Say N if unsure.
> -
> -config BOOTPARAM_HUNG_TASK_PANIC_VALUE
> -	int
> -	depends on DETECT_HUNG_TASK
> -	range 0 1
> -	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
> -	default 1 if BOOTPARAM_HUNG_TASK_PANIC
> -
> -config SCHED_DEBUG
> -	bool "Collect scheduler debugging info"
> -	depends on DEBUG_KERNEL && PROC_FS
> -	default y
> -	help
> -	  If you say Y here, the /proc/sched_debug file will be provided
> -	  that can help debug the scheduler. The runtime overhead of this
> -	  option is minimal.
> -
> -config SCHEDSTATS
> -	bool "Collect scheduler statistics"
> -	depends on DEBUG_KERNEL && PROC_FS
> -	help
> -	  If you say Y here, additional code will be inserted into the
> -	  scheduler and related routines to collect statistics about
> -	  scheduler behavior and provide them in /proc/schedstat.  These
> -	  stats may be useful for both tuning and debugging the scheduler
> -	  If you aren't debugging the scheduler or trying to tune a specific
> -	  application, you can say N to avoid the very slight overhead
> -	  this adds.
> -
> -config TIMER_STATS
> -	bool "Collect kernel timers statistics"
> -	depends on DEBUG_KERNEL && PROC_FS
> -	help
> -	  If you say Y here, additional code will be inserted into the
> -	  timer routines to collect statistics about kernel timers being
> -	  reprogrammed. The statistics can be read from /proc/timer_stats.
> -	  The statistics collection is started by writing 1 to /proc/timer_stats,
> -	  writing 0 stops it. This feature is useful to collect information
> -	  about timer usage patterns in kernel and userspace. This feature
> -	  is lightweight if enabled in the kernel config but not activated
> -	  (it defaults to deactivated on bootup and will only be activated
> -	  if some application like powertop activates it explicitly).
> -
> -config DEBUG_OBJECTS
> -	bool "Debug object operations"
> -	depends on DEBUG_KERNEL
> -	help
> -	  If you say Y here, additional code will be inserted into the
> -	  kernel to track the life time of various objects and validate
> -	  the operations on those objects.
> -
> -config DEBUG_OBJECTS_SELFTEST
> -	bool "Debug objects selftest"
> -	depends on DEBUG_OBJECTS
> -	help
> -	  This enables the selftest of the object debug code.
> -
> -config DEBUG_OBJECTS_FREE
> -	bool "Debug objects in freed memory"
> -	depends on DEBUG_OBJECTS
> -	help
> -	  This enables checks whether a k/v free operation frees an area
> -	  which contains an object which has not been deactivated
> -	  properly. This can make kmalloc/kfree-intensive workloads
> -	  much slower.
> -
> -config DEBUG_OBJECTS_TIMERS
> -	bool "Debug timer objects"
> -	depends on DEBUG_OBJECTS
> -	help
> -	  If you say Y here, additional code will be inserted into the
> -	  timer routines to track the life time of timer objects and
> -	  validate the timer operations.
> -
> -config DEBUG_OBJECTS_WORK
> -	bool "Debug work objects"
> -	depends on DEBUG_OBJECTS
> -	help
> -	  If you say Y here, additional code will be inserted into the
> -	  work queue routines to track the life time of work objects and
> -	  validate the work operations.
> -
> -config DEBUG_OBJECTS_RCU_HEAD
> -	bool "Debug RCU callbacks objects"
> -	depends on DEBUG_OBJECTS
> -	help
> -	  Enable this to turn on debugging of RCU list heads (call_rcu() usage).
> -
> -config DEBUG_OBJECTS_PERCPU_COUNTER
> -	bool "Debug percpu counter objects"
> -	depends on DEBUG_OBJECTS
> -	help
> -	  If you say Y here, additional code will be inserted into the
> -	  percpu counter routines to track the life time of percpu counter
> -	  objects and validate the percpu counter operations.
> -
> -config DEBUG_OBJECTS_ENABLE_DEFAULT
> -	int "debug_objects bootup default value (0-1)"
> -        range 0 1
> -        default "1"
> -        depends on DEBUG_OBJECTS
> -        help
> -          Debug objects boot parameter default value
> -
> -config DEBUG_SLAB
> -	bool "Debug slab memory allocations"
> -	depends on DEBUG_KERNEL && SLAB && !KMEMCHECK
> -	help
> -	  Say Y here to have the kernel do limited verification on memory
> -	  allocation as well as poisoning memory on free to catch use of freed
> -	  memory. This can make kmalloc/kfree-intensive workloads much slower.
> +	  Say Y here to enable the kernel to detect "hung tasks",
> +	  which are bugs that cause the task to be stuck in
> +	  uninterruptible "D" state indefinitiley.
> 
> -config DEBUG_SLAB_LEAK
> -	bool "Memory leak debugging"
> -	depends on DEBUG_SLAB
> +	  When a hung task is detected, the kernel will print the
> +	  current stack trace (which you should report), but the
> +	  task will stay in uninterruptible state. If lockdep is
> +	  enabled then all held locks will also be reported. This
> +	  feature has negligible overhead.
> 
> -config SLUB_DEBUG_ON
> -	bool "SLUB debugging on by default"
> -	depends on SLUB && SLUB_DEBUG && !KMEMCHECK
> -	default n
> +config DEFAULT_HUNG_TASK_TIMEOUT
> +	int "Default timeout for hung task detection (in seconds)"
> +	depends on DETECT_HUNG_TASK
> +	default 120
>  	help
> -	  Boot with debugging on by default. SLUB boots by default with
> -	  the runtime debug capabilities switched off. Enabling this is
> -	  equivalent to specifying the "slub_debug" parameter on boot.
> -	  There is no support for more fine grained debug control like
> -	  possible with slub_debug=xxx. SLUB debugging may be switched
> -	  off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
> -	  "slub_debug=-".
> +	  This option controls the default timeout (in seconds) used
> +	  to determine when a task has become non-responsive and should
> +	  be considered hung.
> 
> -config SLUB_STATS
> -	default n
> -	bool "Enable SLUB performance statistics"
> -	depends on SLUB && SYSFS
> -	help
> -	  SLUB statistics are useful to debug SLUBs allocation behavior in
> -	  order find ways to optimize the allocator. This should never be
> -	  enabled for production use since keeping statistics slows down
> -	  the allocator by a few percentage points. The slabinfo command
> -	  supports the determination of the most active slabs to figure
> -	  out which slabs are relevant to a particular load.
> -	  Try running: slabinfo -DA
> +	  It can be adjusted at runtime via the kernel.hung_task_timeout_secs
> +	  sysctl or by writing a value to
> +	  /proc/sys/kernel/hung_task_timeout_secs.
> 
> -config HAVE_DEBUG_KMEMLEAK
> -	bool
> +	  A timeout of 0 disables the check.  The default is two minutes.
> +	  Keeping the default should be fine in most cases.
> 
> -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
> +config BOOTPARAM_HUNG_TASK_PANIC
> +	bool "Panic (Reboot) On Hung Tasks"
> +	depends on DETECT_HUNG_TASK
>  	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/kmemleak.txt for more
> -	  details.
> +	  Say Y here to enable the kernel to panic on "hung tasks",
> +	  which are bugs that cause the kernel to leave a task stuck
> +	  in uninterruptible "D" state.
> 
> -	  Enabling DEBUG_SLAB or SLUB_DEBUG may increase the chances
> -	  of finding leaks due to the slab objects poisoning.
> +	  The panic can be used in combination with panic_timeout,
> +	  to cause the system to reboot automatically after a
> +	  hung task has been detected. This feature is useful for
> +	  high-availability systems that have uptime guarantees and
> +	  where a hung tasks must be resolved ASAP.
> 
> -	  In order to access the kmemleak file, debugfs needs to be
> -	  mounted (usually at /sys/kernel/debug).
> +	  Say N if unsure.
> 
> -config DEBUG_KMEMLEAK_EARLY_LOG_SIZE
> -	int "Maximum kmemleak early log entries"
> -	depends on DEBUG_KMEMLEAK
> -	range 200 40000
> -	default 400
> -	help
> -	  Kmemleak must track all the memory allocations to avoid
> -	  reporting false positives. Since memory may be allocated or
> -	  freed before kmemleak is initialised, an early log buffer is
> -	  used to store these actions. If kmemleak reports "early log
> -	  buffer exceeded", please increase this value.
> +config BOOTPARAM_HUNG_TASK_PANIC_VALUE
> +	int
> +	depends on DETECT_HUNG_TASK
> +	range 0 1
> +	default 0 if !BOOTPARAM_HUNG_TASK_PANIC
> +	default 1 if BOOTPARAM_HUNG_TASK_PANIC
> 
> -config DEBUG_KMEMLEAK_TEST
> -	tristate "Simple test for the kernel memory leak detector"
> -	depends on DEBUG_KMEMLEAK && m
> +config SCHED_DEBUG
> +	bool "Collect scheduler debugging info"
> +	depends on DEBUG_KERNEL && PROC_FS
> +	default y
>  	help
> -	  This option enables a module that explicitly leaks memory.
> +	  If you say Y here, the /proc/sched_debug file will be provided
> +	  that can help debug the scheduler. The runtime overhead of this
> +	  option is minimal.
> 
> -	  If unsure, say N.
> +config SCHEDSTATS
> +	bool "Collect scheduler statistics"
> +	depends on DEBUG_KERNEL && PROC_FS
> +	help
> +	  If you say Y here, additional code will be inserted into the
> +	  scheduler and related routines to collect statistics about
> +	  scheduler behavior and provide them in /proc/schedstat.  These
> +	  stats may be useful for both tuning and debugging the scheduler
> +	  If you aren't debugging the scheduler or trying to tune a specific
> +	  application, you can say N to avoid the very slight overhead
> +	  this adds.
> 
> -config DEBUG_KMEMLEAK_DEFAULT_OFF
> -	bool "Default kmemleak to off"
> -	depends on DEBUG_KMEMLEAK
> +config TIMER_STATS
> +	bool "Collect kernel timers statistics"
> +	depends on DEBUG_KERNEL && PROC_FS
>  	help
> -	  Say Y here to disable kmemleak by default. It can then be enabled
> -	  on the command line via kmemleak=on.
> +	  If you say Y here, additional code will be inserted into the
> +	  timer routines to collect statistics about kernel timers being
> +	  reprogrammed. The statistics can be read from /proc/timer_stats.
> +	  The statistics collection is started by writing 1 to /proc/timer_stats,
> +	  writing 0 stops it. This feature is useful to collect information
> +	  about timer usage patterns in kernel and userspace. This feature
> +	  is lightweight if enabled in the kernel config but not activated
> +	  (it defaults to deactivated on bootup and will only be activated
> +	  if some application like powertop activates it explicitly).
> 
>  config DEBUG_PREEMPT
>  	bool "Debug preemptible kernel"
> @@ -672,15 +797,6 @@ config STACKTRACE
>  	bool
>  	depends on STACKTRACE_SUPPORT
> 
> -config DEBUG_STACK_USAGE
> -	bool "Stack utilization instrumentation"
> -	depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
> -	help
> -	  Enables the display of the minimum amount of free stack which each
> -	  task has ever had available in the sysrq-T and sysrq-P debug output.
> -
> -	  This option will slow down process creation somewhat.
> -
>  config DEBUG_KOBJECT
>  	bool "kobject debugging"
>  	depends on DEBUG_KERNEL
> @@ -688,13 +804,6 @@ config DEBUG_KOBJECT
>  	  If you say Y here, some extra kobject debugging messages will be sent
>  	  to the syslog. 
> 
> -config DEBUG_HIGHMEM
> -	bool "Highmem debugging"
> -	depends on DEBUG_KERNEL && HIGHMEM
> -	help
> -	  This options enables addition error checking for high memory systems.
> -	  Disable for production systems.
> -
>  config HAVE_DEBUG_BUGVERBOSE
>  	bool
> 
> @@ -733,40 +842,6 @@ config DEBUG_INFO_REDUCED
>  	  DEBUG_INFO build and compile times are reduced too.
>  	  Only works with newer gcc versions.
> 
> -config DEBUG_VM
> -	bool "Debug VM"
> -	depends on DEBUG_KERNEL
> -	help
> -	  Enable this to turn on extended checks in the virtual-memory system
> -          that may impact performance.
> -
> -	  If unsure, say N.
> -
> -config DEBUG_VM_RB
> -	bool "Debug VM red-black trees"
> -	depends on DEBUG_VM
> -	help
> -	  Enable this to turn on more extended checks in the virtual-memory
> -	  system that may impact performance.
> -
> -	  If unsure, say N.
> -
> -config DEBUG_VIRTUAL
> -	bool "Debug VM translations"
> -	depends on DEBUG_KERNEL && X86
> -	help
> -	  Enable some costly sanity checks in virtual to page code. This can
> -	  catch mistakes with virt_to_page() and friends.
> -
> -	  If unsure, say N.
> -
> -config DEBUG_NOMMU_REGIONS
> -	bool "Debug the global anon/private NOMMU mapping region tree"
> -	depends on DEBUG_KERNEL && !MMU
> -	help
> -	  This option causes the global tree of anonymous and private mapping
> -	  regions to be regularly checked for invalid topology.
> -
>  config DEBUG_WRITECOUNT
>  	bool "Debug filesystem writers count"
>  	depends on DEBUG_KERNEL
> @@ -777,18 +852,6 @@ config DEBUG_WRITECOUNT
> 
>  	  If unsure, say N.
> 
> -config DEBUG_MEMORY_INIT
> -	bool "Debug memory initialisation" if EXPERT
> -	default !EXPERT
> -	help
> -	  Enable this for additional checks during memory initialisation.
> -	  The sanity checks verify aspects of the VM such as the memory model
> -	  and other information provided by the architecture. Verbose
> -	  information will be printed at KERN_DEBUG loglevel depending
> -	  on the mminit_loglevel= command-line option.
> -
> -	  If unsure, say Y
> -
>  config DEBUG_LIST
>  	bool "Debug linked list manipulation"
>  	depends on DEBUG_KERNEL
> @@ -1088,17 +1151,6 @@ config DEBUG_FORCE_WEAK_PER_CPU
>  	  To ensure that generic code follows the above rules, this
>  	  option forces all percpu variables to be defined as weak.
> 
> -config DEBUG_PER_CPU_MAPS
> -	bool "Debug access to per_cpu maps"
> -	depends on DEBUG_KERNEL
> -	depends on SMP
> -	help
> -	  Say Y to verify that the per_cpu map being accessed has
> -	  been set up. This adds a fair amount of code to kernel memory
> -	  and decreases performance.
> -
> -	  Say N if unsure.
> -
>  config LKDTM
>  	tristate "Linux Kernel Dump Test Tool Module"
>  	depends on DEBUG_FS
> @@ -1173,29 +1225,6 @@ config PM_NOTIFIER_ERROR_INJECT
> 
>  	  If unsure, say N.
> 
> -config MEMORY_NOTIFIER_ERROR_INJECT
> -	tristate "Memory hotplug notifier error injection module"
> -	depends on MEMORY_HOTPLUG_SPARSE && NOTIFIER_ERROR_INJECTION
> -	help
> -	  This option provides the ability to inject artificial errors to
> -	  memory hotplug notifier chain callbacks.  It is controlled through
> -	  debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
> -
> -	  If the notifier call chain should be failed with some events
> -	  notified, write the error code to "actions/<notifier event>/error".
> -
> -	  Example: Inject memory hotplug offline error (-12 == -ENOMEM)
> -
> -	  # cd /sys/kernel/debug/notifier-error-inject/memory
> -	  # echo -12 > actions/MEM_GOING_OFFLINE/error
> -	  # echo offline > /sys/devices/system/memory/memoryXXX/state
> -	  bash: echo: write error: Cannot allocate memory
> -
> -	  To compile this code as a module, choose M here: the module will
> -	  be called memory-notifier-error-inject.
> -
> -	  If unsure, say N.
> -
>  config OF_RECONFIG_NOTIFIER_ERROR_INJECT
>  	tristate "OF reconfig notifier error injection module"
>  	depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
> @@ -1310,7 +1339,6 @@ config DEBUG_STRICT_USER_COPY_CHECKS
> 
>  	  If unsure, say N.
> 
> -source mm/Kconfig.debug
>  source kernel/trace/Kconfig
> 
>  config RBTREE_TEST
> @@ -1475,33 +1503,10 @@ config ASYNC_RAID6_TEST
> 
>  	  If unsure, say N.
> 
> -config HAVE_DEBUG_STACKOVERFLOW
> -	bool
> -
> -config DEBUG_STACKOVERFLOW
> -	bool "Check for stack overflows"
> -	depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
> -	---help---
> -	  Say Y here if you want to check for overflows of kernel, IRQ
> -	  and exception stacks (if your archicture uses them). This
> -	  option will show detailed messages if free stack space drops
> -	  below a certain limit.
> -
> -	  These kinds of bugs usually occur when call-chains in the
> -	  kernel get too deep, especially when interrupts are
> -	  involved.
> -
> -	  Use this in cases where you see apparently random memory
> -	  corruption, especially if it appears in 'struct thread_info'
> -
> -	  If in doubt, say "N".
> -
>  source "samples/Kconfig"
> 
>  source "lib/Kconfig.kgdb"
> 
> -source "lib/Kconfig.kmemcheck"
> -
>  config TEST_STRING_HELPERS
>  	tristate "Test functions located in the string_helpers module at runtime"
> 
> _
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

* Re: [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet
  2013-05-09 17:31 ` Kent Overstreet
@ 2013-05-09 18:12   ` Dave Jones
  0 siblings, 0 replies; 13+ messages in thread
From: Dave Jones @ 2013-05-09 18:12 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: Dave Hansen, mmarek, linux-kbuild, linux-kernel, tj, akpm

On Thu, May 09, 2013 at 10:31:30AM -0700, Kent Overstreet wrote:

 > > Let's try to introduce some sanity.  This set takes that 120 lines
 > > down to 55 and makes it vastly easier to find some things.  It's a
 > > start.
 > > 
 > Any chance this could go in sooner than later? I spend way too much time
 > hunting down options in kernel hacking and I spend enough time in that
 > menu that I should have the damn thing memorized by now.

+1. I was concerned that Dave had dropped this since the first time
it got posted a few months ago.  That stuff is long overdue a cleanup.


	Dave


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

* Re: [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet
  2013-05-07 20:46 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
@ 2013-05-09 17:31 ` Kent Overstreet
  2013-05-09 18:12   ` Dave Jones
  0 siblings, 1 reply; 13+ messages in thread
From: Kent Overstreet @ 2013-05-09 17:31 UTC (permalink / raw)
  To: Dave Hansen; +Cc: mmarek, linux-kbuild, linux-kernel, tj, akpm

On Tue, May 07, 2013 at 01:46:42PM -0700, Dave Hansen wrote:
> Michal, I figure you're the most logical person for these to go
> through.
> 
> There is a fair amount of churn in the areas around these patches
> so I've resolved conflicts a couple of times.  For the patches that
> are almost purely code move patches, I'm doing this:
> 
> 	cat foo.patch | grep '^[-+]' | perl -pe 's/^.//' | sort | uniq -c | sort -n
> 
> and watching for any non-even numbers coming out of uniq.  This
> helps me make sure I'm not adding/removing code that I should not
> be.
> 
> The Signed-off-by's in here look funky.  I changed employers
> while working on this set, so I have signoffs from both email
> addresses.
> 
> ---
> 
> I think the "Kernel Hacking" menu has gotten a bit out of hand.  It
> is over 120 lines long on my system with everything enabled and
> options are scattered around it haphazardly.
> 
>         http://sr71.net/~dave/linux/kconfig-horror.png
> 
> Let's try to introduce some sanity.  This set takes that 120 lines
> down to 55 and makes it vastly easier to find some things.  It's a
> start.
> 
> This set stands on its own, but there is plenty of room for follow-up
> patches.  The arch-specific debug options still end up getting stuck
> in the top-level "kernel hacking" menu.  OPTIMIZE_INLINING, for
> instance, could obviously go in to the "compiler options" menu, but
> the fact that it is defined in arch/ in a separate Kconfig file keeps
> it on its own for the moment.

Yes, please!

I'm sure there's more that could be done but, like you said, it's a
start - and a significant one.

Any chance this could go in sooner than later? I spend way too much time
hunting down options in kernel hacking and I spend enough time in that
menu that I should have the damn thing memorized by now.

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

* [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet
@ 2013-05-07 20:46 Dave Hansen
  2013-05-09 17:31 ` Kent Overstreet
  0 siblings, 1 reply; 13+ messages in thread
From: Dave Hansen @ 2013-05-07 20:46 UTC (permalink / raw)
  To: mmarek; +Cc: linux-kbuild, linux-kernel, Dave Hansen

Michal, I figure you're the most logical person for these to go
through.

There is a fair amount of churn in the areas around these patches
so I've resolved conflicts a couple of times.  For the patches that
are almost purely code move patches, I'm doing this:

	cat foo.patch | grep '^[-+]' | perl -pe 's/^.//' | sort | uniq -c | sort -n

and watching for any non-even numbers coming out of uniq.  This
helps me make sure I'm not adding/removing code that I should not
be.

The Signed-off-by's in here look funky.  I changed employers
while working on this set, so I have signoffs from both email
addresses.

---

I think the "Kernel Hacking" menu has gotten a bit out of hand.  It
is over 120 lines long on my system with everything enabled and
options are scattered around it haphazardly.

        http://sr71.net/~dave/linux/kconfig-horror.png

Let's try to introduce some sanity.  This set takes that 120 lines
down to 55 and makes it vastly easier to find some things.  It's a
start.

This set stands on its own, but there is plenty of room for follow-up
patches.  The arch-specific debug options still end up getting stuck
in the top-level "kernel hacking" menu.  OPTIMIZE_INLINING, for
instance, could obviously go in to the "compiler options" menu, but
the fact that it is defined in arch/ in a separate Kconfig file keeps
it on its own for the moment.


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

* [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet
@ 2012-12-17 18:22 Dave Hansen
  0 siblings, 0 replies; 13+ messages in thread
From: Dave Hansen @ 2012-12-17 18:22 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, linux-kbuild, linux-arch, Dave Hansen

I think the "Kernel Hacking" menu has gotten a bit out of hand.  It
is over 120 lines long on my system with everything enabled and
options are scattered around it haphazardly.

	http://sr71.net/~dave/linux/kconfig-horror.png

Let's try to introduce some sanity.

I believe the risk of a series like this is pretty low, so I'd like
to see these make it in to 3.8 if there are no major objections.

This set stands on its own, but there is plenty of room for follow-up
patches.  The arch-specific debug options still end up getting stuck
in the top-level "kernel hacking" menu.  OPTIMIZE_INLINING, for
instance, could obviously go in to the "compiler options" menu, but
the fact that it is defined in arch/ in a separate Kconfig file keeps
it on its own.

Any thoughts on how we could address this going forward?

1. Define all arch-specific debugging options in lib/Kconfig.debug
   Have the architectures 'select' them.

2. Introduce some Kconfig language changes that allow menu
   position to be specified independently of where the "config"
   text occurs, like an "appears_in":

config DEBUG_INFO
	bool "Compile the kernel with debug info"
	depends on DEBUG_KERNEL
	appears_in "Kernel Hacking/Compiler Options"
	...

   or, perhaps have a directive that says "do not place the
   menu item now, I will specify a place for it later"

3. Stick all of the arch-specific kernel hacking options under
   an arch-specific submenu, despite if they would fit better
   in the "Memory Debugging" or compiler menu.


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

end of thread, other threads:[~2013-07-08 17:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01 20:04 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
2013-07-01 20:04 ` [PATCH 1/7] consolidate per-arch stack overflow debugging options Dave Hansen
2013-07-01 20:04 ` [PATCH 2/7] order memory debugging Kconfig options Dave Hansen
2013-07-08 16:43   ` Paul E. McKenney
2013-07-01 20:04 ` [PATCH 3/7] consolidate runtime testing configs Dave Hansen
2013-07-01 20:04 ` [PATCH 4/7] consolidate compilation option configs Dave Hansen
2013-07-01 20:04 ` [PATCH 5/7] group locking debugging options Dave Hansen
2013-07-01 20:04 ` [PATCH 6/7] kconfig: consolidate printk options Dave Hansen
2013-07-01 20:04 ` [PATCH 7/7] hang and lockup detection menu Dave Hansen
  -- strict thread matches above, loose matches on Subject: below --
2013-05-07 20:46 [PATCH 0/7] Put "Kernel hacking" Kconfig menu on a diet Dave Hansen
2013-05-09 17:31 ` Kent Overstreet
2013-05-09 18:12   ` Dave Jones
2012-12-17 18:22 Dave Hansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.