diff options
author | Michal Hocko <mhocko@suse.cz> | 2014-10-21 03:27:15 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-10-21 17:44:21 -0400 |
commit | a28e785a9f794ba32e603570ab52a262cf963489 (patch) | |
tree | a9337346d14a18a7ee2b7786e676dda88b190352 /kernel/power/process.c | |
parent | 5695be142e203167e3cb515ef86a88424f3524eb (diff) |
PM: convert do_each_thread to for_each_process_thread
as per 0c740d0afc3b (introduce for_each_thread() to replace the buggy
while_each_thread()) get rid of do_each_thread { } while_each_thread()
construct and replace it by a more error prone for_each_thread.
This patch doesn't introduce any user visible change.
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/process.c')
-rw-r--r-- | kernel/power/process.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index 5cc588c1abab..7f0d4343af1b 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -46,13 +46,13 @@ static int try_to_freeze_tasks(bool user_only) | |||
46 | while (true) { | 46 | while (true) { |
47 | todo = 0; | 47 | todo = 0; |
48 | read_lock(&tasklist_lock); | 48 | read_lock(&tasklist_lock); |
49 | do_each_thread(g, p) { | 49 | for_each_process_thread(g, p) { |
50 | if (p == current || !freeze_task(p)) | 50 | if (p == current || !freeze_task(p)) |
51 | continue; | 51 | continue; |
52 | 52 | ||
53 | if (!freezer_should_skip(p)) | 53 | if (!freezer_should_skip(p)) |
54 | todo++; | 54 | todo++; |
55 | } while_each_thread(g, p); | 55 | } |
56 | read_unlock(&tasklist_lock); | 56 | read_unlock(&tasklist_lock); |
57 | 57 | ||
58 | if (!user_only) { | 58 | if (!user_only) { |
@@ -93,11 +93,11 @@ static int try_to_freeze_tasks(bool user_only) | |||
93 | 93 | ||
94 | if (!wakeup) { | 94 | if (!wakeup) { |
95 | read_lock(&tasklist_lock); | 95 | read_lock(&tasklist_lock); |
96 | do_each_thread(g, p) { | 96 | for_each_process_thread(g, p) { |
97 | if (p != current && !freezer_should_skip(p) | 97 | if (p != current && !freezer_should_skip(p) |
98 | && freezing(p) && !frozen(p)) | 98 | && freezing(p) && !frozen(p)) |
99 | sched_show_task(p); | 99 | sched_show_task(p); |
100 | } while_each_thread(g, p); | 100 | } |
101 | read_unlock(&tasklist_lock); | 101 | read_unlock(&tasklist_lock); |
102 | } | 102 | } |
103 | } else { | 103 | } else { |
@@ -229,11 +229,11 @@ void thaw_processes(void) | |||
229 | thaw_workqueues(); | 229 | thaw_workqueues(); |
230 | 230 | ||
231 | read_lock(&tasklist_lock); | 231 | read_lock(&tasklist_lock); |
232 | do_each_thread(g, p) { | 232 | for_each_process_thread(g, p) { |
233 | /* No other threads should have PF_SUSPEND_TASK set */ | 233 | /* No other threads should have PF_SUSPEND_TASK set */ |
234 | WARN_ON((p != curr) && (p->flags & PF_SUSPEND_TASK)); | 234 | WARN_ON((p != curr) && (p->flags & PF_SUSPEND_TASK)); |
235 | __thaw_task(p); | 235 | __thaw_task(p); |
236 | } while_each_thread(g, p); | 236 | } |
237 | read_unlock(&tasklist_lock); | 237 | read_unlock(&tasklist_lock); |
238 | 238 | ||
239 | WARN_ON(!(curr->flags & PF_SUSPEND_TASK)); | 239 | WARN_ON(!(curr->flags & PF_SUSPEND_TASK)); |
@@ -256,10 +256,10 @@ void thaw_kernel_threads(void) | |||
256 | thaw_workqueues(); | 256 | thaw_workqueues(); |
257 | 257 | ||
258 | read_lock(&tasklist_lock); | 258 | read_lock(&tasklist_lock); |
259 | do_each_thread(g, p) { | 259 | for_each_process_thread(g, p) { |
260 | if (p->flags & (PF_KTHREAD | PF_WQ_WORKER)) | 260 | if (p->flags & (PF_KTHREAD | PF_WQ_WORKER)) |
261 | __thaw_task(p); | 261 | __thaw_task(p); |
262 | } while_each_thread(g, p); | 262 | } |
263 | read_unlock(&tasklist_lock); | 263 | read_unlock(&tasklist_lock); |
264 | 264 | ||
265 | schedule(); | 265 | schedule(); |