* [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
@ 2009-02-23 9:35 Pekka Enberg
2009-02-23 15:25 ` Sitsofe Wheeler
2009-02-23 15:41 ` Christoph Lameter
0 siblings, 2 replies; 8+ messages in thread
From: Pekka Enberg @ 2009-02-23 9:35 UTC (permalink / raw)
To: mingo; +Cc: linux-kernel, vegard.nossum, cl
From: Pekka Enberg <penberg@cs.helsinki.fi>
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.
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
arch/x86/Kconfig.debug | 2 +-
init/Kconfig | 2 +-
lib/Kconfig.debug | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index de186c5..3d1d593 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -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
diff --git a/init/Kconfig b/init/Kconfig
index f068071..36617a4 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -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
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 29044f5..768e426 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -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
--
1.5.4.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-23 9:35 [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled Pekka Enberg
@ 2009-02-23 15:25 ` Sitsofe Wheeler
2009-02-23 15:41 ` Christoph Lameter
1 sibling, 0 replies; 8+ messages in thread
From: Sitsofe Wheeler @ 2009-02-23 15:25 UTC (permalink / raw)
To: Pekka Enberg; +Cc: mingo, linux-kernel, vegard.nossum, cl
On Mon, Feb 23, 2009 at 11:35:12AM +0200, Pekka Enberg wrote:
> From: Pekka Enberg <penberg@cs.helsinki.fi>
>
> 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.
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...
--
Sitsofe | http://sucs.org/~sits/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-23 9:35 [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled Pekka Enberg
2009-02-23 15:25 ` Sitsofe Wheeler
@ 2009-02-23 15:41 ` Christoph Lameter
2009-02-23 17:33 ` Pekka Enberg
1 sibling, 1 reply; 8+ messages in thread
From: Christoph Lameter @ 2009-02-23 15:41 UTC (permalink / raw)
To: Pekka Enberg; +Cc: mingo, linux-kernel, vegard.nossum
On Mon, 23 Feb 2009, Pekka Enberg wrote:
> 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.
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-23 15:41 ` Christoph Lameter
@ 2009-02-23 17:33 ` Pekka Enberg
2009-02-25 19:17 ` Vegard Nossum
0 siblings, 1 reply; 8+ messages in thread
From: Pekka Enberg @ 2009-02-23 17:33 UTC (permalink / raw)
To: Christoph Lameter; +Cc: mingo, linux-kernel, vegard.nossum
On Mon, 2009-02-23 at 10:41 -0500, Christoph Lameter wrote:
> On Mon, 23 Feb 2009, Pekka Enberg wrote:
>
> > 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.
>
> 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.
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-23 17:33 ` Pekka Enberg
@ 2009-02-25 19:17 ` Vegard Nossum
2009-02-25 21:23 ` Christoph Lameter
0 siblings, 1 reply; 8+ messages in thread
From: Vegard Nossum @ 2009-02-25 19:17 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Christoph Lameter, mingo, linux-kernel
2009/2/23 Pekka Enberg <penberg@cs.helsinki.fi>:
> On Mon, 2009-02-23 at 10:41 -0500, Christoph Lameter wrote:
>> On Mon, 23 Feb 2009, Pekka Enberg wrote:
>>
>> > 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.
>>
>> 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.
>
> 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.
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
--
"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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-25 19:17 ` Vegard Nossum
@ 2009-02-25 21:23 ` Christoph Lameter
2009-02-26 7:17 ` Pekka Enberg
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Lameter @ 2009-02-25 21:23 UTC (permalink / raw)
To: Vegard Nossum; +Cc: Pekka Enberg, mingo, linux-kernel
On Wed, 25 Feb 2009, Vegard Nossum wrote:
> 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?
!SLUB_DEBUG_ON is the right thing to depend on.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-25 21:23 ` Christoph Lameter
@ 2009-02-26 7:17 ` Pekka Enberg
2009-02-26 8:16 ` Vegard Nossum
0 siblings, 1 reply; 8+ messages in thread
From: Pekka Enberg @ 2009-02-26 7:17 UTC (permalink / raw)
To: Christoph Lameter; +Cc: Vegard Nossum, mingo, linux-kernel
On Wed, 25 Feb 2009, Vegard Nossum wrote:
> > 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?
On Wed, 2009-02-25 at 16:23 -0500, Christoph Lameter wrote:
> !SLUB_DEBUG_ON is the right thing to depend on.
Here's a patch to do that.
Pekka
>From bae2afd233c24d766e20e09bb92c67c0e5ea16e3 Mon Sep 17 00:00:00 2001
From: Pekka Enberg <penberg@cs.helsinki.fi>
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.
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
arch/x86/Kconfig.debug | 2 +-
lib/Kconfig.debug | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index de186c5..3d1d593 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -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
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 29044f5..e9a930c 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -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
--
1.5.4.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled
2009-02-26 7:17 ` Pekka Enberg
@ 2009-02-26 8:16 ` Vegard Nossum
0 siblings, 0 replies; 8+ messages in thread
From: Vegard Nossum @ 2009-02-26 8:16 UTC (permalink / raw)
To: Pekka Enberg; +Cc: Christoph Lameter, mingo, linux-kernel
2009/2/26 Pekka Enberg <penberg@cs.helsinki.fi>:
> From: Pekka Enberg <penberg@cs.helsinki.fi>
> 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.
>
> Cc: Vegard Nossum <vegard.nossum@gmail.com>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Thanks, applied!
Vegard
--
"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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-02-26 8:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-23 9:35 [PATCH] kmemcheck: Disable SLUB and SLAB debugging when kmemcheck is enabled Pekka Enberg
2009-02-23 15:25 ` Sitsofe Wheeler
2009-02-23 15:41 ` Christoph Lameter
2009-02-23 17:33 ` Pekka Enberg
2009-02-25 19:17 ` Vegard Nossum
2009-02-25 21:23 ` Christoph Lameter
2009-02-26 7:17 ` Pekka Enberg
2009-02-26 8:16 ` Vegard Nossum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®