mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Pinning down a blocked task to extract diagnostics
@ 2020-03-05  0:50 Paul E. McKenney
  2020-03-05  3:52 ` Steven Rostedt
  2020-03-05  8:07 ` Peter Zijlstra
  0 siblings, 2 replies; 12+ messages in thread
From: Paul E. McKenney @ 2020-03-05  0:50 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman
  Cc: linux-kernel

Hello!

Suppose that I need to extract diagnostics information from a blocked
task, but that I absolutely cannot tolerate this task awakening in the
midst of this extraction process.  Is the following code the right way
to make this work given a task "t"?

	raw_spin_lock_irq(&t->pi_lock);
	if (t->on_rq) {
		/* Task no longer blocked, so ignore it. */
	} else {
		/* Extract consistent diagnostic information. */
	}
	raw_spin_unlock_irq(&t->pi_lock);

It looks like all the wakeup paths acquire ->pi_lock, but I figured I
should actually ask...

							Thanx, Paul

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-03-06 21:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-05  0:50 Pinning down a blocked task to extract diagnostics 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
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

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®