Skip to contentSkip to conversation

x86: use asm-generic/dma-mapping-common.h

PATCH Pekka Enberg 2 participants 3 messages Jun 22, 2009 8 messages not in the archive Library code

lore
Share & tools
lore
#8 lore raw
In reply to a message not in the archive
Quoted 28 lines · Catalin Marinas
Quoted 25 lines · Ingo Molnar
Quoted 11 lines · Vegard Nossum

Seems to be CONFIG_DEBUG_SLAB=y that is the culprit in this case. Hm, is Kconfig busted?

lib/Kconfig.debug:301:config DEBUG_SLAB lib/Kconfig.debug-302- bool "Debug slab memory allocations" lib/Kconfig.debug:303: depends on DEBUG_KERNEL && SLAB && !KMEMCHECK

fujita-config:1475:CONFIG_DEBUG_SLAB=y
fujita-config:1558:CONFIG_KMEMCHECK=y

...what gives? Pekka?

Kmemleak introduced this piece of not so nice solution recently:

(quoted diff) +9 -0
+config DEBUG_KMEMLEAK
+       bool "Kernel memory leak detector"
+       depends on DEBUG_KERNEL && EXPERIMENTAL && (X86 || ARM) && \
+               !MEMORY_HOTPLUG
+       select DEBUG_SLAB if SLAB
+       select SLUB_DEBUG if SLUB
+       select DEBUG_FS if SYSFS
+       select STACKTRACE if STACKTRACE_SUPPORT
+       select KALLSYMS
Quoted 1 line

that should be a depends line, not a select line.

Quoted 8 lines

Kmemleak doesn't strictly need DEBUG_SLAB to make it a dependency. But enabling it may reduce (in theory) the false negatives by poisoning the allocated objects (and hence clearing any possible pointers to other objects). But I don't have any figures to show this is the case. I'll post a patch to drop those selects.

BTW, wouldn't it be feasible for kbuild to ignore the select statements if the selected config has unmet dependencies?

Hmm, no idea, lets cc some relevant people here. But can we remove the select and add a config option help text to kmemleak as a short-term solution?

Pekka

#9 lore raw
Quoted 35 lines · Pekka Enberg
Quoted 34 lines · Catalin Marinas
Quoted 25 lines · Ingo Molnar
Quoted 11 lines · Vegard Nossum

Seems to be CONFIG_DEBUG_SLAB=y that is the culprit in this case. Hm, is Kconfig busted?

lib/Kconfig.debug:301:config DEBUG_SLAB lib/Kconfig.debug-302- bool "Debug slab memory allocations" lib/Kconfig.debug:303: depends on DEBUG_KERNEL && SLAB && !KMEMCHECK

fujita-config:1475:CONFIG_DEBUG_SLAB=y
fujita-config:1558:CONFIG_KMEMCHECK=y

...what gives? Pekka?

Kmemleak introduced this piece of not so nice solution recently:

(quoted diff) +9 -0
+config DEBUG_KMEMLEAK
+       bool "Kernel memory leak detector"
+       depends on DEBUG_KERNEL && EXPERIMENTAL && (X86 || ARM) && \
+               !MEMORY_HOTPLUG
+       select DEBUG_SLAB if SLAB
+       select SLUB_DEBUG if SLUB
+       select DEBUG_FS if SYSFS
+       select STACKTRACE if STACKTRACE_SUPPORT
+       select KALLSYMS
Quoted 1 line

that should be a depends line, not a select line.

Kmemleak doesn't strictly need DEBUG_SLAB to make it a dependency. But enabling it may reduce (in theory) the false negatives by poisoning the allocated objects (and hence clearing any possible pointers to other objects). But I don't have any figures to show this is the case. I'll post a patch to drop those selects.

Quoted 6 lines
Quoted 2 lines

BTW, wouldn't it be feasible for kbuild to ignore the select statements if the selected config has unmet dependencies?

Hmm, no idea, lets cc some relevant people here. But can we remove the select and add a config option help text to kmemleak as a short-term solution?

Here it is:

kmemleak: Do not force the slab debugging Kconfig options

From: Catalin Marinas <[email protected]>

Selecting DEBUG_SLAB or SLUB_DEBUG by the KMEMLEAK menu entry may cause issues with other dependencies (KMEMCHECK). These configuration options aren't strictly needed by kmemleak but they may increase the chances of finding leaks. This patch also updates the KMEMLEAK config entry help text.

---
 lib/Kconfig.debug |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
lib/Kconfig.debug +3 -2
index 23067ab..4c32b1a 100644
@@ -340,8 +340,6 @@ config DEBUG_KMEMLEAK
 	bool "Kernel memory leak detector"
 	depends on DEBUG_KERNEL && EXPERIMENTAL && (X86 || ARM) && \
 		!MEMORY_HOTPLUG
-	select DEBUG_SLAB if SLAB
-	select SLUB_DEBUG if SLUB
 	select DEBUG_FS if SYSFS
 	select STACKTRACE if STACKTRACE_SUPPORT
 	select KALLSYMS
@@ -355,6 +353,9 @@ config DEBUG_KMEMLEAK
 	  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).
 
Signature · 1 line
Catalin
author Acked-by
#10 lore raw
Quoted 11 lines · Catalin Marinas

kmemleak: Do not force the slab debugging Kconfig options

From: Catalin Marinas <[email protected]>

Selecting DEBUG_SLAB or SLUB_DEBUG by the KMEMLEAK menu entry may cause issues with other dependencies (KMEMCHECK). These configuration options aren't strictly needed by kmemleak but they may increase the chances of finding leaks. This patch also updates the KMEMLEAK config entry help text.