aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-09-01 11:12:44 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2009-09-04 16:05:55 +0100
commit43ed5d6ee0f9bfd655d6bc3cb2d964b80c4422c0 (patch)
treee201f0d610a44dbc9e09cec13b52c5cce351136a
parent8e019366ba749a536131cde1947af6dcaccf8e8f (diff)
kmemleak: Scan all thread stacks
This patch changes the for_each_process() loop with the do_each_thread()/while_each_thread() pair. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r--mm/kmemleak.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index c494fee7a2b..74d4089d758 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1074,7 +1074,6 @@ static void kmemleak_scan(void)
{
unsigned long flags;
struct kmemleak_object *object, *tmp;
- struct task_struct *task;
int i;
int new_leaks = 0;
int gray_list_pass = 0;
@@ -1141,15 +1140,16 @@ static void kmemleak_scan(void)
}
/*
- * Scanning the task stacks may introduce false negatives and it is
- * not enabled by default.
+ * Scanning the task stacks (may introduce false negatives).
*/
if (kmemleak_stack_scan) {
+ struct task_struct *p, *g;
+
read_lock(&tasklist_lock);
- for_each_process(task)
- scan_block(task_stack_page(task),
- task_stack_page(task) + THREAD_SIZE,
- NULL, 0);
+ do_each_thread(g, p) {
+ scan_block(task_stack_page(p), task_stack_page(p) +
+ THREAD_SIZE, NULL, 0);
+ } while_each_thread(g, p);
read_unlock(&tasklist_lock);
}