lkml.org 
[lkml]   [2012]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] PM/Freezer: Make thaw_processes() thaw only userspace tasks
Date
Currently the situation is:

freeze_processes() - freezes only userspace tasks
freeze_kernel_threads() - freezes only kernel threads
thaw_kernel_threads() - thaws only kernel threads
thaw_processes() - thaws *everything* (both userspace tasks and kernel threads)

The point that thaw_processes() thaws everything is rather unintuitive
and can lead to bugs. So, modify thaw_processes() so that it thaws only
userspace processes. This way we can also have more control over what
exactly gets thawed in different situations.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

kernel/power/process.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index eeca003..def6b1b 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -170,17 +170,15 @@ void thaw_processes(void)
if (pm_freezing)
atomic_dec(&system_freezing_cnt);
pm_freezing = false;
- pm_nosig_freezing = false;

oom_killer_enable();

printk("Restarting tasks ... ");

- thaw_workqueues();
-
read_lock(&tasklist_lock);
do_each_thread(g, p) {
- __thaw_task(p);
+ if (!(p->flags & (PF_KTHREAD | PF_WQ_WORKER)))
+ __thaw_task(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);



\
 
 \ /
  Last update: 2012-01-30 23:07    [W:0.042 / U:7.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site