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

Commit 3a592405 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu: Allow task-level idle entry/exit nesting



The current task-level idle entry/exit code forces an entry/exit on
each call, regardless of the nesting level.  This commit therefore
properly accounts for nesting.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
parent 96d3fd0d
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -418,11 +418,12 @@ static void rcu_eqs_enter(bool user)
	rdtp = this_cpu_ptr(&rcu_dynticks);
	oldval = rdtp->dynticks_nesting;
	WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0);
	if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE)
	if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) {
		rdtp->dynticks_nesting = 0;
	else
		rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE;
		rcu_eqs_enter_common(rdtp, oldval, user);
	} else {
		rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE;
	}
}

/**
@@ -540,12 +541,13 @@ static void rcu_eqs_exit(bool user)
	rdtp = this_cpu_ptr(&rcu_dynticks);
	oldval = rdtp->dynticks_nesting;
	WARN_ON_ONCE(oldval < 0);
	if (oldval & DYNTICK_TASK_NEST_MASK)
	if (oldval & DYNTICK_TASK_NEST_MASK) {
		rdtp->dynticks_nesting += DYNTICK_TASK_NEST_VALUE;
	else
	} else {
		rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
		rcu_eqs_exit_common(rdtp, oldval, user);
	}
}

/**
 * rcu_idle_exit - inform RCU that current CPU is leaving idle