]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Revert "Allow post-unlock reference for rt_mutex" to avoid priority-inversion
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 18 Nov 2014 08:30:01 +0000 (16:30 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 6 Jan 2015 19:02:52 +0000 (11:02 -0800)
commit13a0d561722c783675e1c8e62a5898b181924df8
tree017561fdbffe2f3e840d6af7c5a7bbcf015c70c9
parent85961bbbe475cf7401bee36e4284d07ebd10f0dc
rcu: Revert "Allow post-unlock reference for rt_mutex" to avoid priority-inversion

The patch b592f1ea4d10 ("Allow post-unlock reference for rt_mutex")
ensured rcu-boost safe even the rt_mutex has post-unlock reference.

But rt_mutex allowing post-unlock reference is definitely a bug and it was
fixed by the commit 5b836ae8288a ("rtmutex: Plug slow unlock race").
This fix made the previous patch (b592f1ea4d10) useless.

And even worse, the priority-inversion introduced by the the previous
patch still exists.

rcu_read_unlock_special() {
rt_mutex_unlock(&rnp->boost_mtx);
/* Priority-Inversion:
 * the current task had been deboosted and preempted as a low
 * priority task immediately, it could wait long before reschedule in,
 * and the rcu-booster also waits on this low priority task and sleeps.
 * This priority-inversion makes rcu-booster can't work
 * as expected.
 */
complete(&rnp->boost_completion);
}

Just revert the patch to avoid it.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.h
kernel/rcu/tree_plugin.h