From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932604AbbCQOO0 (ORCPT ); Tue, 17 Mar 2015 10:14:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55017 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932097AbbCQOOW (ORCPT ); Tue, 17 Mar 2015 10:14:22 -0400 From: Aaron Tomlin To: akpm@linux-foundation.org Cc: oleg@redhat.com, rientjes@google.com, dwysocha@redhat.com, atomlin@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] hung_task: Change hung_task.c to use for_each_process_thread() Date: Tue, 17 Mar 2015 14:13:44 +0000 Message-Id: <1426601624-6703-2-git-send-email-atomlin@redhat.com> In-Reply-To: <1426601624-6703-1-git-send-email-atomlin@redhat.com> References: <1426601624-6703-1-git-send-email-atomlin@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In check_hung_uninterruptible_tasks() avoid the use of deprecated while_each_thread(). The "max_count" logic will prevents 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(). Signed-off-by: Aaron Tomlin --- 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 06db124..e0f90c2 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -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) { @@ -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(); } -- 1.9.3