From: Rafael J. Wysocki Date: Wed, 23 May 2007 20:57:26 +0000 (-0700) Subject: freezer: take kernel_execve into consideration X-Git-Tag: MMI-PSA29.97-13-9~42949 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=49b12d4f5e274517b8bc032d507abf31cc2f4150;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git freezer: take kernel_execve into consideration Kernel threads can become userland processes by calling kernel_execve(). In particular, this may happen right after the try_to_freeze_tasks() called with FREEZER_USER_SPACE has returned, so try_to_freeze_tasks() needs to take userspace processes into consideration even if it is called with FREEZER_KERNEL_THREADS. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Cc: Gautham R Shenoy Cc: Oleg Nesterov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/process.c b/kernel/power/process.c index eefca8581fa0..2cea2658e985 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -120,7 +120,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space) cancel_freezing(p); continue; } - if (is_user_space(p) == !freeze_user_space) + if (freeze_user_space && !is_user_space(p)) continue; freeze_process(p); @@ -147,7 +147,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space) TIMEOUT / HZ, todo); read_lock(&tasklist_lock); do_each_thread(g, p) { - if (is_user_space(p) == !freeze_user_space) + if (freeze_user_space && !is_user_space(p)) continue; task_lock(p);