diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-03-01 10:26:41 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-01 10:26:43 +0100 |
commit | 7e4d960993331e92567f0180e45322a93e6780ba (patch) | |
tree | 4d7444035303fc0b545e88afbd894176344fb2a3 /kernel/power/process.c | |
parent | de5bdff7a72acc281219be2b8edeeca1fd81c542 (diff) | |
parent | 164974a8f2a482f1abcb027c6d1a89dd79b14297 (diff) | |
download | linux-stable-7e4d960993331e92567f0180e45322a93e6780ba.tar.gz linux-stable-7e4d960993331e92567f0180e45322a93e6780ba.tar.bz2 linux-stable-7e4d960993331e92567f0180e45322a93e6780ba.zip |
Merge branch 'linus' into sched/core
Merge reason: we'll queue up dependent patches.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/power/process.c')
-rw-r--r-- | kernel/power/process.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index 77274c9ba2f1..7e426459e60a 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -143,7 +143,10 @@ int freeze_processes(void) /** * freeze_kernel_threads - Make freezable kernel threads go to the refrigerator. * - * On success, returns 0. On failure, -errno and system is fully thawed. + * On success, returns 0. On failure, -errno and only the kernel threads are + * thawed, so as to give a chance to the caller to do additional cleanups + * (if any) before thawing the userspace tasks. So, it is the responsibility + * of the caller to thaw the userspace tasks, when the time is right. */ int freeze_kernel_threads(void) { @@ -159,7 +162,7 @@ int freeze_kernel_threads(void) BUG_ON(in_atomic()); if (error) - thaw_processes(); + thaw_kernel_threads(); return error; } @@ -188,3 +191,22 @@ void thaw_processes(void) printk("done.\n"); } +void thaw_kernel_threads(void) +{ + struct task_struct *g, *p; + + pm_nosig_freezing = false; + printk("Restarting kernel threads ... "); + + thaw_workqueues(); + + read_lock(&tasklist_lock); + do_each_thread(g, p) { + if (p->flags & (PF_KTHREAD | PF_WQ_WORKER)) + __thaw_task(p); + } while_each_thread(g, p); + read_unlock(&tasklist_lock); + + schedule(); + printk("done.\n"); +} |