From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
bsegall@google.com, mgorman@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: Pinning down a blocked task to extract diagnostics
Date: Thu, 5 Mar 2020 09:01:36 -0500 [thread overview]
Message-ID: <20200305090136.09f4bebf@gandalf.local.home> (raw)
In-Reply-To: <20200305081337.GA2619@hirez.programming.kicks-ass.net>
On Thu, 5 Mar 2020 09:13:37 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> > Close, the thing pi_lock actually guards is the t->state transition *to*
> > TASK_WAKING/TASK_RUNNING, so something like this:
>
> Almost, we must indeed also check ->on_rq, otherwise it might change the
> state back itself.
>
> >
> > raw_spin_lock_irq(&t->pi_lock);
> > switch (t->state) {
> > case TASK_RUNNING:
> > case TASK_WAKING:
> > /* ignore */
> > break;
> >
> > default:
Don't we need a smp_rmb() here, otherwise we could have the same issue as
described in the comment in try_to_wake_up()?
-- Steve
> if (t->on_rq)
> break;
>
> > /* Extract consistent diagnostic information. */
> > break;
> > }
> > raw_spin_unlock_irq(&t->pi_lock);
> >
> > ought to work. But if you're going to do this, please add a reference to
> > that code in a comment on top of try_to_wake_up(), such that we can
> > later find all the code that relies on this.
next prev parent reply other threads:[~2020-03-05 14:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 0:50 Paul E. McKenney
2020-03-05 3:52 ` Steven Rostedt
2020-03-05 4:25 ` Paul E. McKenney
2020-03-05 8:07 ` Peter Zijlstra
2020-03-05 8:13 ` Peter Zijlstra
2020-03-05 14:01 ` Steven Rostedt [this message]
2020-03-05 14:22 ` Paul E. McKenney
2020-03-05 14:28 ` Steven Rostedt
2020-03-05 15:36 ` Paul E. McKenney
2020-03-06 1:40 ` Paul E. McKenney
2020-03-06 16:56 ` Steven Rostedt
2020-03-06 21:01 ` Paul E. McKenney
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=20200305090136.09f4bebf@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
/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
all inboxes | Powered by JetHome®