diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2011-11-15 23:49:09 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2011-12-02 16:12:42 +0000 |
commit | 029aeff5db879afd7760f11214b6fea45f76b58e (patch) | |
tree | deac6984f163841a7996d7a8f39db49f66684c72 | |
parent | f528f0b8e53d73b18be71e96693cfab9322f33c7 (diff) | |
download | linux-3.10-029aeff5db879afd7760f11214b6fea45f76b58e.tar.gz linux-3.10-029aeff5db879afd7760f11214b6fea45f76b58e.tar.bz2 linux-3.10-029aeff5db879afd7760f11214b6fea45f76b58e.zip |
kmemleak: Add support for memory hotplug
Ensure that memory hotplug can co-exist with kmemleak
by taking the hotplug lock before scanning the memory
banks.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | lib/Kconfig.debug | 2 | ||||
-rw-r--r-- | mm/kmemleak.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 82928f5ea04..8745ac7d1f7 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -414,7 +414,7 @@ config SLUB_STATS config DEBUG_KMEMLEAK bool "Kernel memory leak detector" - depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \ + depends on DEBUG_KERNEL && EXPERIMENTAL && \ (X86 || ARM || PPC || MIPS || S390 || SPARC64 || SUPERH || MICROBLAZE || TILE) select DEBUG_FS diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 15c50302ff9..c833addd94d 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -100,6 +100,7 @@ #include <linux/kmemcheck.h> #include <linux/kmemleak.h> +#include <linux/memory_hotplug.h> /* * Kmemleak configuration and common defines. @@ -1292,9 +1293,9 @@ static void kmemleak_scan(void) #endif /* - * Struct page scanning for each node. The code below is not yet safe - * with MEMORY_HOTPLUG. + * Struct page scanning for each node. */ + lock_memory_hotplug(); for_each_online_node(i) { pg_data_t *pgdat = NODE_DATA(i); unsigned long start_pfn = pgdat->node_start_pfn; @@ -1313,6 +1314,7 @@ static void kmemleak_scan(void) scan_block(page, page + 1, NULL, 1); } } + unlock_memory_hotplug(); /* * Scanning the task stacks (may introduce false negatives). |