aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/process.c')
-rw-r--r--kernel/power/process.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 9f6f5c755cfa..0beb51e1dec9 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -101,7 +101,7 @@ static int try_to_freeze_tasks(bool sig_only)
101 read_lock(&tasklist_lock); 101 read_lock(&tasklist_lock);
102 do_each_thread(g, p) { 102 do_each_thread(g, p) {
103 if (!wakeup && !freezer_should_skip(p) && 103 if (!wakeup && !freezer_should_skip(p) &&
104 freezing(p) && !frozen(p)) 104 p != current && freezing(p) && !frozen(p))
105 sched_show_task(p); 105 sched_show_task(p);
106 } while_each_thread(g, p); 106 } while_each_thread(g, p);
107 read_unlock(&tasklist_lock); 107 read_unlock(&tasklist_lock);
@@ -122,7 +122,11 @@ int freeze_processes(void)
122{ 122{
123 int error; 123 int error;
124 124
125 if (!pm_freezing)
126 atomic_inc(&system_freezing_cnt);
127
125 printk("Freezing user space processes ... "); 128 printk("Freezing user space processes ... ");
129 pm_freezing = true;
126 error = try_to_freeze_tasks(true); 130 error = try_to_freeze_tasks(true);
127 if (!error) { 131 if (!error) {
128 printk("done."); 132 printk("done.");
@@ -146,6 +150,7 @@ int freeze_kernel_threads(void)
146 int error; 150 int error;
147 151
148 printk("Freezing remaining freezable tasks ... "); 152 printk("Freezing remaining freezable tasks ... ");
153 pm_nosig_freezing = true;
149 error = try_to_freeze_tasks(false); 154 error = try_to_freeze_tasks(false);
150 if (!error) 155 if (!error)
151 printk("done."); 156 printk("done.");
@@ -162,6 +167,11 @@ void thaw_processes(void)
162{ 167{
163 struct task_struct *g, *p; 168 struct task_struct *g, *p;
164 169
170 if (pm_freezing)
171 atomic_dec(&system_freezing_cnt);
172 pm_freezing = false;
173 pm_nosig_freezing = false;
174
165 oom_killer_enable(); 175 oom_killer_enable();
166 176
167 printk("Restarting tasks ... "); 177 printk("Restarting tasks ... ");
@@ -170,9 +180,6 @@ void thaw_processes(void)
170 180
171 read_lock(&tasklist_lock); 181 read_lock(&tasklist_lock);
172 do_each_thread(g, p) { 182 do_each_thread(g, p) {
173 if (cgroup_freezing(p))
174 continue;
175
176 __thaw_task(p); 183 __thaw_task(p);
177 } while_each_thread(g, p); 184 } while_each_thread(g, p);
178 read_unlock(&tasklist_lock); 185 read_unlock(&tasklist_lock);