Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

rcu: Don't check irq nesting from rcu idle entry/exit



Because tasks do not nest, rcu_idle_enter() and rcu_idle_exit() do
not need to check for nesting.  This commit therefore moves nesting
checks from rcu_idle_enter_common() to rcu_irq_exit() and from
rcu_idle_exit_common() to rcu_irq_enter().

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 7cb92499
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -350,10 +350,6 @@ static int rcu_implicit_offline_qs(struct rcu_data *rdp)
 */
static void rcu_idle_enter_common(struct rcu_dynticks *rdtp, long long oldval)
{
	if (rdtp->dynticks_nesting) {
		trace_rcu_dyntick("--=", oldval, rdtp->dynticks_nesting);
		return;
	}
	trace_rcu_dyntick("Start", oldval, rdtp->dynticks_nesting);
	if (!is_idle_task(current)) {
		struct task_struct *idle = idle_task(smp_processor_id());
@@ -426,6 +422,9 @@ void rcu_irq_exit(void)
	oldval = rdtp->dynticks_nesting;
	rdtp->dynticks_nesting--;
	WARN_ON_ONCE(rdtp->dynticks_nesting < 0);
	if (rdtp->dynticks_nesting)
		trace_rcu_dyntick("--=", oldval, rdtp->dynticks_nesting);
	else
		rcu_idle_enter_common(rdtp, oldval);
	local_irq_restore(flags);
}
@@ -439,10 +438,6 @@ void rcu_irq_exit(void)
 */
static void rcu_idle_exit_common(struct rcu_dynticks *rdtp, long long oldval)
{
	if (oldval) {
		trace_rcu_dyntick("++=", oldval, rdtp->dynticks_nesting);
		return;
	}
	smp_mb__before_atomic_inc();  /* Force ordering w/previous sojourn. */
	atomic_inc(&rdtp->dynticks);
	/* CPUs seeing atomic_inc() must see later RCU read-side crit sects */
@@ -518,6 +513,9 @@ void rcu_irq_enter(void)
	oldval = rdtp->dynticks_nesting;
	rdtp->dynticks_nesting++;
	WARN_ON_ONCE(rdtp->dynticks_nesting == 0);
	if (oldval)
		trace_rcu_dyntick("++=", oldval, rdtp->dynticks_nesting);
	else
		rcu_idle_exit_common(rdtp, oldval);
	local_irq_restore(flags);
}