]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcu: Remove swake_up_one_online() bandaid
authorFrederic Weisbecker <frederic@kernel.org>
Tue, 31 Dec 2024 17:07:11 +0000 (18:07 +0100)
committerJoel Fernandes <joelagnelf@nvidia.com>
Fri, 16 May 2025 13:00:54 +0000 (09:00 -0400)
It's now ok to perform a wake-up from an offline CPU because the
resulting armed scheduler bandwidth hrtimers are now correctly targeted
by hrtimer infrastructure.

Remove the obsolete hackerry.

Link: https://lore.kernel.org/all/20241231170712.149394-3-frederic@kernel.org/
Reviewed-by: Usama Arif <usamaarif642@gmail.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
kernel/rcu/tree.c
kernel/rcu/tree_exp.h
kernel/rcu/tree_nocb.h

index 659f83e7104869a8e03c2f52086d6609cbc94b72..1b8eee06183c93a0021bce2019f6499b81d06c8a 100644 (file)
@@ -1060,38 +1060,6 @@ static bool rcu_future_gp_cleanup(struct rcu_node *rnp)
        return needmore;
 }
 
-static void swake_up_one_online_ipi(void *arg)
-{
-       struct swait_queue_head *wqh = arg;
-
-       swake_up_one(wqh);
-}
-
-static void swake_up_one_online(struct swait_queue_head *wqh)
-{
-       int cpu = get_cpu();
-
-       /*
-        * If called from rcutree_report_cpu_starting(), wake up
-        * is dangerous that late in the CPU-down hotplug process. The
-        * scheduler might queue an ignored hrtimer. Defer the wake up
-        * to an online CPU instead.
-        */
-       if (unlikely(cpu_is_offline(cpu))) {
-               int target;
-
-               target = cpumask_any_and(housekeeping_cpumask(HK_TYPE_RCU),
-                                        cpu_online_mask);
-
-               smp_call_function_single(target, swake_up_one_online_ipi,
-                                        wqh, 0);
-               put_cpu();
-       } else {
-               put_cpu();
-               swake_up_one(wqh);
-       }
-}
-
 /*
  * Awaken the grace-period kthread.  Don't do a self-awaken (unless in an
  * interrupt or softirq handler, in which case we just might immediately
@@ -1116,7 +1084,7 @@ static void rcu_gp_kthread_wake(void)
                return;
        WRITE_ONCE(rcu_state.gp_wake_time, jiffies);
        WRITE_ONCE(rcu_state.gp_wake_seq, READ_ONCE(rcu_state.gp_seq));
-       swake_up_one_online(&rcu_state.gp_wq);
+       swake_up_one(&rcu_state.gp_wq);
 }
 
 /*
index 8d4895c854c5954918625cea8198ca35215f93c7..c36c7d5575ca21e4b4a6fef5237ad6a5bb867f11 100644 (file)
@@ -200,7 +200,7 @@ static void __rcu_report_exp_rnp(struct rcu_node *rnp,
                if (rnp->parent == NULL) {
                        raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
                        if (wake)
-                               swake_up_one_online(&rcu_state.expedited_wq);
+                               swake_up_one(&rcu_state.expedited_wq);
 
                        break;
                }
index fa269d34167a903066e4706339762b5638d397f3..109bc2df1d9a5639d19b7d7f7c0600e874280bcb 100644 (file)
@@ -216,7 +216,7 @@ static bool __wake_nocb_gp(struct rcu_data *rdp_gp,
        raw_spin_unlock_irqrestore(&rdp_gp->nocb_gp_lock, flags);
        if (needwake) {
                trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("DoWake"));
-               swake_up_one_online(&rdp_gp->nocb_gp_wq);
+               swake_up_one(&rdp_gp->nocb_gp_wq);
        }
 
        return needwake;