提交 49b12d4f 编写于 作者: R Rafael J. Wysocki 提交者: Linus Torvalds

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: NRafael J. Wysocki <rjw@sisk.pl>
Acked-by: NPavel 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ba96a0c8
...@@ -120,7 +120,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space) ...@@ -120,7 +120,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space)
cancel_freezing(p); cancel_freezing(p);
continue; continue;
} }
if (is_user_space(p) == !freeze_user_space) if (freeze_user_space && !is_user_space(p))
continue; continue;
freeze_process(p); freeze_process(p);
...@@ -147,7 +147,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space) ...@@ -147,7 +147,7 @@ static unsigned int try_to_freeze_tasks(int freeze_user_space)
TIMEOUT / HZ, todo); TIMEOUT / HZ, todo);
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
do_each_thread(g, p) { do_each_thread(g, p) {
if (is_user_space(p) == !freeze_user_space) if (freeze_user_space && !is_user_space(p))
continue; continue;
task_lock(p); task_lock(p);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册