diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-09-01 06:12:44 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-09-04 11:05:55 -0400 |
commit | 43ed5d6ee0f9bfd655d6bc3cb2d964b80c4422c0 (patch) | |
tree | e201f0d610a44dbc9e09cec13b52c5cce351136a /mm | |
parent | 8e019366ba749a536131cde1947af6dcaccf8e8f (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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/kmemleak.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c494fee7a2b5..74d4089d7588 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -1074,7 +1074,6 @@ static void kmemleak_scan(void) | |||
1074 | { | 1074 | { |
1075 | unsigned long flags; | 1075 | unsigned long flags; |
1076 | struct kmemleak_object *object, *tmp; | 1076 | struct kmemleak_object *object, *tmp; |
1077 | struct task_struct *task; | ||
1078 | int i; | 1077 | int i; |
1079 | int new_leaks = 0; | 1078 | int new_leaks = 0; |
1080 | int gray_list_pass = 0; | 1079 | int gray_list_pass = 0; |
@@ -1141,15 +1140,16 @@ static void kmemleak_scan(void) | |||
1141 | } | 1140 | } |
1142 | 1141 | ||
1143 | /* | 1142 | /* |
1144 | * Scanning the task stacks may introduce false negatives and it is | 1143 | * Scanning the task stacks (may introduce false negatives). |
1145 | * not enabled by default. | ||
1146 | */ | 1144 | */ |
1147 | if (kmemleak_stack_scan) { | 1145 | if (kmemleak_stack_scan) { |
1146 | struct task_struct *p, *g; | ||
1147 | |||
1148 | read_lock(&tasklist_lock); | 1148 | read_lock(&tasklist_lock); |
1149 | for_each_process(task) | 1149 | do_each_thread(g, p) { |
1150 | scan_block(task_stack_page(task), | 1150 | scan_block(task_stack_page(p), task_stack_page(p) + |
1151 | task_stack_page(task) + THREAD_SIZE, | 1151 | THREAD_SIZE, NULL, 0); |
1152 | NULL, 0); | 1152 | } while_each_thread(g, p); |
1153 | read_unlock(&tasklist_lock); | 1153 | read_unlock(&tasklist_lock); |
1154 | } | 1154 | } |
1155 | 1155 | ||