From: Oleg Nesterov <oleg@redhat.com>
To: Aaron Tomlin <atomlin@redhat.com>
Cc: akpm@linux-foundation.org, rientjes@google.com,
dwysocha@redhat.com, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH 0/2] hung_task: improve rcu_lock_break() logic
Date: Tue, 17 Mar 2015 20:24:50 +0100 [thread overview]
Message-ID: <20150317192450.GA32579@redhat.com> (raw)
In-Reply-To: <20150317170920.GA21493@redhat.com>
On 03/17, 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 <oleg@redhat.com>
>
>
>
> 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...
>
> But I agree, lets start from this fix, then we will see.
Something like this. on top of Aaron's change.
But actually I am not sure this really makes a lot of sense. But if
yes, we can do more. We can save g->start_time before rcu_lock_break(),
and then "both dead" case can use for_each_process() to (try to) find
the first process whis has a ge start_time.
Oleg.
next prev parent reply other threads:[~2015-03-17 19:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 14:13 [PATCH 0/1] hung_task: Change hung_task.c to use for_each_process_thread() Aaron Tomlin
2015-03-17 14:13 ` [PATCH 1/1] " Aaron Tomlin
2015-03-17 17:09 ` Oleg Nesterov
2015-03-17 17:18 ` Aaron Tomlin
2015-03-17 19:24 ` Oleg Nesterov [this message]
2015-03-17 19:25 ` [PATCH 1/2] hung_task: split for_each_process_thread() into for_each_process() + __for_each_thread() Oleg Nesterov
2015-03-20 16:55 ` Aaron Tomlin
2015-03-17 19:25 ` [PATCH 2/2] hung_task: improve the rcu_lock_break() logic Oleg Nesterov
2015-03-20 16:55 ` Aaron Tomlin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150317192450.GA32579@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=atomlin@redhat.com \
--cc=dwysocha@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox