Thread (8 messages) 8 messages, 5 authors, 2016-10-20

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

From: Hillf Danton <hidden>
Date: 2016-10-12 10:22:53
Also in: lkml

quoted hunk ↗ jump to hunk
@@ -1453,8 +1453,11 @@ static void kmemleak_scan(void)

 		read_lock(&tasklist_lock);
 		do_each_thread(g, p) {
Take a look at this commit please.
	1da4db0cd5 ("oom_kill: change oom_kill.c to use for_each_thread()")
-			scan_block(task_stack_page(p), task_stack_page(p) +
-				   THREAD_SIZE, NULL);
+			void *stack = try_get_task_stack(p);
+			if (stack) {
+				scan_block(stack, stack + THREAD_SIZE, NULL);
+				put_task_stack(p);
+			}
 		} while_each_thread(g, p);
 		read_unlock(&tasklist_lock);
 	}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help