kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
Subsystems (2)
PATCH 1/1 kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
From: Pekka Enberg <[email protected]>
Enabling kmemcheck in Kconfig is a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.
--- arch/x86/Kconfig.debug | 2 +- init/Kconfig | 2 +- lib/Kconfig.debug | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/Kconfig.debug +1 -1
@@ -276,7 +276,7 @@ menuconfig KMEMCHECK bool "kmemcheck: trap use of uninitialized memory" depends on X86 depends on !X86_USE_3DNOW - depends on (SLUB && !SLUB_DEBUG_ON) || (SLAB && !DEBUG_SLAB) + depends on SLUB || SLAB depends on !CC_OPTIMIZE_FOR_SIZE depends on !DEBUG_PAGEALLOC depends on !FUNCTION_TRACER
init/Kconfig +1 -1
@@ -890,7 +890,7 @@ config PCI_QUIRKS config SLUB_DEBUG default y bool "Enable SLUB debugging support" if EMBEDDED - depends on SLUB && SYSFS + depends on SLUB && SYSFS && !KMEMCHECK help SLUB has extensive debug support features. Disabling these can result in significant savings in code size. This also disables
lib/Kconfig.debug +1 -1
@@ -262,7 +262,7 @@ config DEBUG_OBJECTS_ENABLE_DEFAULT config DEBUG_SLAB bool "Debug slab memory allocations" - depends on DEBUG_KERNEL && SLAB + 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
Signature · 1 line
1.5.4.3
Quoted 6 lines · Pekka Enberg
From: Pekka Enberg <[email protected]>
Enabling kmemcheck in
Kconfigis a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.
You may also want to add something in the Documentation/kmemcheck.txt saying that it conflicts with CONFIG_DEBUG_PAGEALLOC and CONFIG_SLUB_DEBUG so that people realise why it is not presented as an option...
Signature · 1 line
Sitsofe | http://sucs.org/~sits/
Quoted 4 lines · Pekka Enberg
Enabling kmemcheck in
Kconfigis a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.
SLUB_DEBUG is fundamentally different from SLAB_DEBUG. It only includes the code to be able to enable debugging at runtime. It does not enable debugging.
Quoted 10 lines · Christoph Lameter
Quoted 4 lines · Pekka Enberg
Enabling kmemcheck in
Kconfigis a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.
SLUB_DEBUGis fundamentally different fromSLAB_DEBUG. It only includes the code to be able to enable debugging at runtime. It does not enable debugging.
Yes, I know that but we can't really let the user enable both, slub debugging and kmemcheck debugging, at run-time. That's why I used SLUB_DEBUG here.
2009/2/23 Pekka Enberg <[email protected]>:
Quoted 8 lines · Christoph Lameter
Quoted 7 lines · Pekka Enberg
Quoted 5 lines
Enabling kmemcheck in
Kconfigis a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.
Quoted 7 lines
Quoted 3 lines
SLUB_DEBUGis fundamentally different fromSLAB_DEBUG. It only includes the code to be able to enable debugging at runtime. It does not enable debugging.Yes, I know that but we can't really let the user enable both, slub debugging and kmemcheck debugging, at run-time. That's why I used
SLUB_DEBUGhere.
It is possible. Which is why it said SLUB_DEBUG_ON to begin with. This is how it works:
If slub_debug=,xyz is specified on the command line, the SLUB debugging will be used for the "xyz" cache, and kmemcheck will track the rest (all non-slub-debugged caches). So if we only disable SLUB_DEBUG_ON, then slub debugging and kmemcheck debugging can still be mixed at boot-time, but kmemcheck will take precedence unless slub_debug= is specified.
Can you rethink whether SLUB_DEBUG or SLUB_DEBUG_ON is the one we really want to depend on !KMEMCHECK, and either submit a new patch or convince me that this is sufficient?
Thanks!
Vegard
Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036
Quoted 3 lines · Vegard Nossum
Can you rethink whether
SLUB_DEBUGorSLUB_DEBUG_ONis the one we really want to depend on !KMEMCHECK, and either submit a new patch or convince me that this is sufficient?
!SLUB_DEBUG_ON is the right thing to depend on.
Quoted 3 lines · Vegard Nossum
Quoted 3 lines
Can you rethink whether
SLUB_DEBUGorSLUB_DEBUG_ONis the one we really want to depend on !KMEMCHECK, and either submit a new patch or convince me that this is sufficient?
Quoted 1 line · Christoph Lameter
!SLUB_DEBUG_ON is the right thing to depend on.
Here's a patch to do that.
Pekka
Quoted 1 line
From
bae2afd233c24d766e20e09bb92c67c0e5ea16e3Mon Sep 17 00:00:00 2001
From: Pekka Enberg <[email protected]>
Date: Mon, 23 Feb 2009 11:35:13 +0200
Subject: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
Enabling kmemcheck in Kconfig is a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.
--- arch/x86/Kconfig.debug | 2 +- lib/Kconfig.debug | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/Kconfig.debug +1 -1
@@ -276,7 +276,7 @@ menuconfig KMEMCHECK bool "kmemcheck: trap use of uninitialized memory" depends on X86 depends on !X86_USE_3DNOW - depends on (SLUB && !SLUB_DEBUG_ON) || (SLAB && !DEBUG_SLAB) + depends on SLUB || SLAB depends on !CC_OPTIMIZE_FOR_SIZE depends on !DEBUG_PAGEALLOC depends on !FUNCTION_TRACER
lib/Kconfig.debug +2 -2
@@ -262,7 +262,7 @@ config DEBUG_OBJECTS_ENABLE_DEFAULT config DEBUG_SLAB bool "Debug slab memory allocations" - depends on DEBUG_KERNEL && SLAB + 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
@@ -274,7 +274,7 @@ config DEBUG_SLAB_LEAK config SLUB_DEBUG_ON bool "SLUB debugging on by default" - depends on SLUB && SLUB_DEBUG + depends on SLUB && SLUB_DEBUG && !KMEMCHECK default n help Boot with debugging on by default. SLUB boots by default with
Signature · 1 line
1.5.4.3
Vegard Nossum
Applied2009/2/26 Pekka Enberg <[email protected]>:
Quoted 4 lines
From: Pekka Enberg <[email protected]>
Date: Mon, 23 Feb 2009 11:35:13 +0200
Subject: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
Quoted 8 lines
Enabling kmemcheck in
Kconfigis a painful experience. Lets make it a tad bit easier by inverting the dependencies to SLUB and SLAB debugging. As kmemcheck is more powerful than slab debugging, disable the latter functionality if an user enables kmemcheck.Cc Vegard Nossum <[email protected]>Cc Christoph Lameter <[email protected]>Signed-off-by Pekka Enberg <[email protected]>
Thanks, applied!
Vegard
Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036