aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-02-10 18:00:34 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-02-13 10:26:05 -0500
commit6c83b4818dd65eb17e633b6b629a81da7bed90b3 (patch)
tree97eddcc6d07daf0ea1be84c57e7a687b3d406151 /kernel/power
parent7c95149b7f1f61201b12c73c4862a41bf2428961 (diff)
PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()
Use the observation that it is more efficient to check the wakeup variable once before the loop reporting tasks that were not frozen in try_to_freeze_tasks() than to do that in every step of that loop. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/process.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 7e426459e60a..6aeb5efe00eb 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -98,13 +98,15 @@ static int try_to_freeze_tasks(bool user_only)
98 elapsed_csecs / 100, elapsed_csecs % 100, 98 elapsed_csecs / 100, elapsed_csecs % 100,
99 todo - wq_busy, wq_busy); 99 todo - wq_busy, wq_busy);
100 100
101 read_lock(&tasklist_lock); 101 if (!wakeup) {
102 do_each_thread(g, p) { 102 read_lock(&tasklist_lock);
103 if (!wakeup && !freezer_should_skip(p) && 103 do_each_thread(g, p) {
104 p != current && freezing(p) && !frozen(p)) 104 if (p != current && !freezer_should_skip(p)
105 sched_show_task(p); 105 && freezing(p) && !frozen(p))
106 } while_each_thread(g, p); 106 sched_show_task(p);
107 read_unlock(&tasklist_lock); 107 } while_each_thread(g, p);
108 read_unlock(&tasklist_lock);
109 }
108 } else { 110 } else {
109 printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100, 111 printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
110 elapsed_csecs % 100); 112 elapsed_csecs % 100);