diff options
author | Laura Abbott <lauraa@codeaurora.org> | 2011-11-15 18:49:09 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2011-12-02 11:12:42 -0500 |
commit | 029aeff5db879afd7760f11214b6fea45f76b58e (patch) | |
tree | deac6984f163841a7996d7a8f39db49f66684c72 /mm | |
parent | f528f0b8e53d73b18be71e96693cfab9322f33c7 (diff) |
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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/kmemleak.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 15c50302ff93..c833addd94d7 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -100,6 +100,7 @@ | |||
100 | 100 | ||
101 | #include <linux/kmemcheck.h> | 101 | #include <linux/kmemcheck.h> |
102 | #include <linux/kmemleak.h> | 102 | #include <linux/kmemleak.h> |
103 | #include <linux/memory_hotplug.h> | ||
103 | 104 | ||
104 | /* | 105 | /* |
105 | * Kmemleak configuration and common defines. | 106 | * Kmemleak configuration and common defines. |
@@ -1292,9 +1293,9 @@ static void kmemleak_scan(void) | |||
1292 | #endif | 1293 | #endif |
1293 | 1294 | ||
1294 | /* | 1295 | /* |
1295 | * Struct page scanning for each node. The code below is not yet safe | 1296 | * Struct page scanning for each node. |
1296 | * with MEMORY_HOTPLUG. | ||
1297 | */ | 1297 | */ |
1298 | lock_memory_hotplug(); | ||
1298 | for_each_online_node(i) { | 1299 | for_each_online_node(i) { |
1299 | pg_data_t *pgdat = NODE_DATA(i); | 1300 | pg_data_t *pgdat = NODE_DATA(i); |
1300 | unsigned long start_pfn = pgdat->node_start_pfn; | 1301 | unsigned long start_pfn = pgdat->node_start_pfn; |
@@ -1313,6 +1314,7 @@ static void kmemleak_scan(void) | |||
1313 | scan_block(page, page + 1, NULL, 1); | 1314 | scan_block(page, page + 1, NULL, 1); |
1314 | } | 1315 | } |
1315 | } | 1316 | } |
1317 | unlock_memory_hotplug(); | ||
1316 | 1318 | ||
1317 | /* | 1319 | /* |
1318 | * Scanning the task stacks (may introduce false negatives). | 1320 | * Scanning the task stacks (may introduce false negatives). |