aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/process.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-05-23 16:57:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 23:14:11 -0400
commit49b12d4f5e274517b8bc032d507abf31cc2f4150 (patch)
tree4663d224a86ea848742716f6f4ec708e9a3c04b3 /kernel/power/process.c
parentba96a0c88098697a63e80157718b7440414ed24d (diff)
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 <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: Gautham R Shenoy <ego@in.ibm.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power/process.c')
-rw-r--r--kernel/power/process.c4
1 files changed, 2 insertions, 2 deletions
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)
120 cancel_freezing(p); 120 cancel_freezing(p);
121 continue; 121 continue;
122 } 122 }
123 if (is_user_space(p) == !freeze_user_space) 123 if (freeze_user_space && !is_user_space(p))
124 continue; 124 continue;
125 125
126 freeze_process(p); 126 freeze_process(p);
@@ -147,7 +147,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space)
147 TIMEOUT / HZ, todo); 147 TIMEOUT / HZ, todo);
148 read_lock(&tasklist_lock); 148 read_lock(&tasklist_lock);
149 do_each_thread(g, p) { 149 do_each_thread(g, p) {
150 if (is_user_space(p) == !freeze_user_space) 150 if (freeze_user_space && !is_user_space(p))
151 continue; 151 continue;
152 152
153 task_lock(p); 153 task_lock(p);