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.

Change-Id: I0b7de998533c87ae3f9bc46e42753fe1fdc6f402
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>
This commit is contained in:
Michal Hocko 2014-10-21 09:27:15 +02:00 committed by syphyr
parent 00ba716c82
commit 350814e212
1 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ static int try_to_freeze_tasks(bool user_only)
while (true) {
todo = 0;
read_lock(&tasklist_lock);
do_each_thread(g, p) {
for_each_process_thread(g, p) {
if (p == current || !freeze_task(p))
continue;
@ -62,7 +62,7 @@ static int try_to_freeze_tasks(bool user_only)
#if defined(CONFIG_SEC_PM_DEBUG)
q = p;
#endif /* CONFIG_SEC_PM_DEBUG */
} while_each_thread(g, p);
}
read_unlock(&tasklist_lock);
if (!user_only) {
@ -117,11 +117,11 @@ static int try_to_freeze_tasks(bool user_only)
todo - wq_busy, wq_busy);
read_lock(&tasklist_lock);
do_each_thread(g, p) {
for_each_process_thread(g, p) {
if (p != current && !freezer_should_skip(p)
&& freezing(p) && !frozen(p))
sched_show_task(p);
} while_each_thread(g, p);
}
read_unlock(&tasklist_lock);
} else {
printk("(elapsed %d.%03d seconds) ", elapsed_msecs / 1000,
@ -252,11 +252,11 @@ void thaw_processes(void)
cpuset_wait_for_hotplug();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
for_each_process_thread(g, p) {
/* No other threads should have PF_SUSPEND_TASK set */
WARN_ON((p != curr) && (p->flags & PF_SUSPEND_TASK));
__thaw_task(p);
} while_each_thread(g, p);
}
read_unlock(&tasklist_lock);
WARN_ON(!(curr->flags & PF_SUSPEND_TASK));
@ -278,10 +278,10 @@ void thaw_kernel_threads(void)
thaw_workqueues();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
for_each_process_thread(g, p) {
if (p->flags & (PF_KTHREAD | PF_WQ_WORKER))
__thaw_task(p);
} while_each_thread(g, p);
}
read_unlock(&tasklist_lock);
schedule();