[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200305005049.GA21120@paulmck-ThinkPad-P72>
Date: Wed, 4 Mar 2020 16:50:49 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de
Cc: linux-kernel@...r.kernel.org
Subject: Pinning down a blocked task to extract diagnostics
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
Powered by blists - more mailing lists