Skip to content

Commit

Permalink
kernel/hung_task.c: change hung_task.c to use for_each_process_thread()
Browse files Browse the repository at this point in the history
In check_hung_uninterruptible_tasks() avoid the use of deprecated
while_each_thread().

The "max_count" logic will prevent a livelock - see commit 0c740d0
("introduce for_each_thread() to replace the buggy while_each_thread()").
Having said this let's use for_each_process_thread().

Signed-off-by: Aaron Tomlin <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Dave Wysochanski <[email protected]>
Cc: Aaron Tomlin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Aaron Tomlin authored and torvalds committed Apr 15, 2015
1 parent 96831c0 commit 972fae6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/hung_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
return;

rcu_read_lock();
do_each_thread(g, t) {
for_each_process_thread(g, t) {
if (!max_count--)
goto unlock;
if (!--batch_count) {
Expand All @@ -180,7 +180,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
/* use "==" to skip the TASK_KILLABLE tasks waiting on NFS */
if (t->state == TASK_UNINTERRUPTIBLE)
check_hung_task(t, timeout);
} while_each_thread(g, t);
}
unlock:
rcu_read_unlock();
}
Expand Down

0 comments on commit 972fae6

Please sign in to comment.