Skip to content

Commit df7c249

Browse files
Frederic WeisbeckerNeeraj Upadhyay
authored andcommitted
rcu/nocb: Remove halfway (de-)offloading handling from rcu_core
RCU core can't be running anymore while in the middle of (de-)offloading since this sort of transition now only applies to offline CPUs. The locked callback acceleration handling during the transition can therefore be removed, along with concurrent batch execution. Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Paul E. McKenney <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]>
1 parent 5a4f905 commit df7c249

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

kernel/rcu/tree.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,24 +2781,6 @@ static __latent_entropy void rcu_core(void)
27812781
unsigned long flags;
27822782
struct rcu_data *rdp = raw_cpu_ptr(&rcu_data);
27832783
struct rcu_node *rnp = rdp->mynode;
2784-
/*
2785-
* On RT rcu_core() can be preempted when IRQs aren't disabled.
2786-
* Therefore this function can race with concurrent NOCB (de-)offloading
2787-
* on this CPU and the below condition must be considered volatile.
2788-
* However if we race with:
2789-
*
2790-
* _ Offloading: In the worst case we accelerate or process callbacks
2791-
* concurrently with NOCB kthreads. We are guaranteed to
2792-
* call rcu_nocb_lock() if that happens.
2793-
*
2794-
* _ Deoffloading: In the worst case we miss callbacks acceleration or
2795-
* processing. This is fine because the early stage
2796-
* of deoffloading invokes rcu_core() after setting
2797-
* SEGCBLIST_RCU_CORE. So we guarantee that we'll process
2798-
* what could have been dismissed without the need to wait
2799-
* for the next rcu_pending() check in the next jiffy.
2800-
*/
2801-
const bool do_batch = !rcu_segcblist_completely_offloaded(&rdp->cblist);
28022784

28032785
if (cpu_is_offline(smp_processor_id()))
28042786
return;
@@ -2818,17 +2800,17 @@ static __latent_entropy void rcu_core(void)
28182800

28192801
/* No grace period and unregistered callbacks? */
28202802
if (!rcu_gp_in_progress() &&
2821-
rcu_segcblist_is_enabled(&rdp->cblist) && do_batch) {
2822-
rcu_nocb_lock_irqsave(rdp, flags);
2803+
rcu_segcblist_is_enabled(&rdp->cblist) && !rcu_rdp_is_offloaded(rdp)) {
2804+
local_irq_save(flags);
28232805
if (!rcu_segcblist_restempty(&rdp->cblist, RCU_NEXT_READY_TAIL))
28242806
rcu_accelerate_cbs_unlocked(rnp, rdp);
2825-
rcu_nocb_unlock_irqrestore(rdp, flags);
2807+
local_irq_restore(flags);
28262808
}
28272809

28282810
rcu_check_gp_start_stall(rnp, rdp, rcu_jiffies_till_stall_check());
28292811

28302812
/* If there are callbacks ready, invoke them. */
2831-
if (do_batch && rcu_segcblist_ready_cbs(&rdp->cblist) &&
2813+
if (!rcu_rdp_is_offloaded(rdp) && rcu_segcblist_ready_cbs(&rdp->cblist) &&
28322814
likely(READ_ONCE(rcu_scheduler_fully_active))) {
28332815
rcu_do_batch(rdp);
28342816
/* Re-invoke RCU core processing if there are callbacks remaining. */

0 commit comments

Comments
 (0)