Skip to content

Commit b200a04

Browse files
committed
rcu: Force nohz_full tick on upon irq enter instead of exit
There is interrupt-exit code that forces on the tick for nohz_full CPUs failing to respond to the current grace period in a timely fashion. However, this code must compare ->dynticks_nmi_nesting to the value 2 in the interrupt-exit fastpath. This commit therefore moves this code to the interrupt-entry fastpath, where a lighter-weight comparison to zero may be used. Reported-by: Joel Fernandes <[email protected]> [ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU->TICK_DEP_BIT_RCU fix. ] Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 66e4c33 commit b200a04

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/rcu/tree.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,12 +651,6 @@ static __always_inline void rcu_nmi_exit_common(bool irq)
651651
*/
652652
if (rdp->dynticks_nmi_nesting != 1) {
653653
trace_rcu_dyntick(TPS("--="), rdp->dynticks_nmi_nesting, rdp->dynticks_nmi_nesting - 2, rdp->dynticks);
654-
if (tick_nohz_full_cpu(rdp->cpu) &&
655-
rdp->dynticks_nmi_nesting == 2 &&
656-
rdp->rcu_urgent_qs && !rdp->rcu_forced_tick) {
657-
rdp->rcu_forced_tick = true;
658-
tick_dep_set_cpu(rdp->cpu, TICK_DEP_MASK_RCU);
659-
}
660654
WRITE_ONCE(rdp->dynticks_nmi_nesting, /* No store tearing. */
661655
rdp->dynticks_nmi_nesting - 2);
662656
return;
@@ -831,6 +825,11 @@ static __always_inline void rcu_nmi_enter_common(bool irq)
831825
rcu_cleanup_after_idle();
832826

833827
incby = 1;
828+
} else if (tick_nohz_full_cpu(rdp->cpu) &&
829+
rdp->dynticks_nmi_nesting == DYNTICK_IRQ_NONIDLE &&
830+
rdp->rcu_urgent_qs && !rdp->rcu_forced_tick) {
831+
rdp->rcu_forced_tick = true;
832+
tick_dep_set_cpu(rdp->cpu, TICK_DEP_BIT_RCU);
834833
}
835834
trace_rcu_dyntick(incby == 1 ? TPS("Endirq") : TPS("++="),
836835
rdp->dynticks_nmi_nesting,

0 commit comments

Comments
 (0)