From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932947AbbCQRTQ (ORCPT ); Tue, 17 Mar 2015 13:19:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53696 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932679AbbCQRTP (ORCPT ); Tue, 17 Mar 2015 13:19:15 -0400 Date: Tue, 17 Mar 2015 17:18:32 +0000 From: Aaron Tomlin To: Oleg Nesterov Cc: akpm@linux-foundation.org, rientjes@google.com, dwysocha@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] hung_task: Change hung_task.c to use for_each_process_thread() Message-ID: <20150317171832.GE6831@atomlin.usersys.redhat.com> References: <1426601624-6703-1-git-send-email-atomlin@redhat.com> <1426601624-6703-2-git-send-email-atomlin@redhat.com> <20150317170920.GA21493@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150317170920.GA21493@redhat.com> X-PGP-Key: http://pgp.mit.edu/pks/lookup?search=atomlin%40redhat.com X-PGP-Fingerprint: 7906 84EB FA8A 9638 8D1E 6E9B E2DE 9658 19CC 77D6 User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2015-03-17 18:09 +0100, Oleg Nesterov wrote: > On 03/17, Aaron Tomlin wrote: > > > > --- 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); > > + } > > > Acked-by: Oleg Nesterov > > > > Perhaps it also makes sense to improve this rcu_lock_break a bit... > For example, if 't' is dead but 'g' is alive we can continue the > "for_each_process" part of this double loop. And if 't' is still > alive then we can find the new leader and continue... OK - I'll incorporate that in a separate patch. Thanks, -- Aaron Tomlin