From b433431aca317e994fb389444f6f5360e65fcdbd Mon Sep 17 00:00:00 2001 From: Aaron Tomlin Date: Wed, 15 Apr 2015 16:16:47 -0700 Subject: [PATCH] kernel/hung_task.c: change hung_task.c to use for_each_process_thread() In check_hung_uninterruptible_tasks() avoid the use of deprecated while_each_thread(). The "max_count" logic will prevent a livelock - see commit 0c740d0a ("introduce for_each_thread() to replace the buggy while_each_thread()"). Having said this let's use for_each_process_thread(). Change-Id: I607d1819ab824d072f73363b1e429e2d0952b93d Signed-off-by: Aaron Tomlin Acked-by: Oleg Nesterov Cc: David Rientjes Cc: Dave Wysochanski Cc: Aaron Tomlin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/hung_task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 091e632f3538..3cf3a43584bc 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -156,7 +156,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 (time_after(jiffies, last_break + HUNG_TASK_LOCK_BREAK)) { @@ -167,7 +167,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(); }