Commit b9ced9e1 authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Paul E. McKenney
Browse files

rcu/nocb: Set SEGCBLIST_SOFTIRQ_ONLY at the very last stage of de-offloading



This commit sets SEGCBLIST_SOFTIRQ_ONLY once toggling is otherwise fully
complete, allowing further RCU callback manipulation to be carried out
locklessly and locally.

Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Inspired-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Tested-by: default avatarBoqun Feng <boqun.feng@gmail.com>
Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 314202f8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2352,7 +2352,14 @@ static int __rcu_nocb_rdp_deoffload(struct rcu_data *rdp)
	 */
	rcu_nocb_lock_irqsave(rdp, flags);
	rcu_nocb_flush_bypass(rdp, NULL, jiffies);
	rcu_nocb_unlock_irqrestore(rdp, flags);
	rcu_segcblist_set_flags(cblist, SEGCBLIST_SOFTIRQ_ONLY);
	/*
	 * With SEGCBLIST_SOFTIRQ_ONLY, we can't use
	 * rcu_nocb_unlock_irqrestore() anymore. Theoretically we
	 * could set SEGCBLIST_SOFTIRQ_ONLY with cb unlocked and IRQs
	 * disabled now, but let's be paranoid.
	 */
	raw_spin_unlock_irqrestore(&rdp->nocb_lock, flags);

	return ret;
}