]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
kmemleak: Add support for memory hotplug
authorLaura Abbott <lauraa@codeaurora.org>
Tue, 15 Nov 2011 23:49:09 +0000 (23:49 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 2 Dec 2011 16:12:42 +0000 (16:12 +0000)
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>
lib/Kconfig.debug
mm/kmemleak.c

index 82928f5ea0494936e83e9751fb6a1e4107a6efc2..8745ac7d1f7553e9c32e225e160d652a929d9f41 100644 (file)
@@ -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
index 15c50302ff930f0ee0c57f5eadbbed212f8fcd98..c833addd94d74703a90e9bed51d759726e77f280 100644 (file)
 
 #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).