]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - kernel/rcu/tree_plugin.h
rcu: Remove unused ->rcu_read_unlock_special.b.deferred_qs field
[mirror_ubuntu-jammy-kernel.git] / kernel / rcu / tree_plugin.h
index 097635c41135da1954de4b1fc5fc0efc676753f4..f31c5992f8424e8237a3b42f365416b2647a2a61 100644 (file)
@@ -569,16 +569,11 @@ static bool rcu_preempt_need_deferred_qs(struct task_struct *t)
 static void rcu_preempt_deferred_qs(struct task_struct *t)
 {
        unsigned long flags;
-       bool couldrecurse = rcu_preempt_depth() >= 0;
 
        if (!rcu_preempt_need_deferred_qs(t))
                return;
-       if (couldrecurse)
-               rcu_preempt_depth_set(rcu_preempt_depth() - RCU_NEST_BIAS);
        local_irq_save(flags);
        rcu_preempt_deferred_qs_irqrestore(t, flags);
-       if (couldrecurse)
-               rcu_preempt_depth_set(rcu_preempt_depth() + RCU_NEST_BIAS);
 }
 
 /*
@@ -615,19 +610,18 @@ static void rcu_read_unlock_special(struct task_struct *t)
                struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
                struct rcu_node *rnp = rdp->mynode;
 
-               exp = (t->rcu_blocked_node && t->rcu_blocked_node->exp_tasks) ||
-                     (rdp->grpmask & READ_ONCE(rnp->expmask)) ||
-                     tick_nohz_full_cpu(rdp->cpu);
+               exp = (t->rcu_blocked_node &&
+                      READ_ONCE(t->rcu_blocked_node->exp_tasks)) ||
+                     (rdp->grpmask & READ_ONCE(rnp->expmask));
                // Need to defer quiescent state until everything is enabled.
-               if (irqs_were_disabled && use_softirq &&
-                   (in_interrupt() ||
-                    (exp && !t->rcu_read_unlock_special.b.deferred_qs))) {
-                       // Using softirq, safe to awaken, and we get
-                       // no help from enabling irqs, unlike bh/preempt.
+               if (use_softirq && (in_irq() || (exp && !irqs_were_disabled))) {
+                       // Using softirq, safe to awaken, and either the
+                       // wakeup is free or there is an expedited GP.
                        raise_softirq_irqoff(RCU_SOFTIRQ);
                } else {
                        // Enabling BH or preempt does reschedule, so...
-                       // Also if no expediting or NO_HZ_FULL, slow is OK.
+                       // Also if no expediting, slow is OK.
+                       // Plus nohz_full CPUs eventually get tick enabled.
                        set_tsk_need_resched(current);
                        set_preempt_need_resched();
                        if (IS_ENABLED(CONFIG_IRQ_WORK) && irqs_were_disabled &&
@@ -640,7 +634,6 @@ static void rcu_read_unlock_special(struct task_struct *t)
                                irq_work_queue_on(&rdp->defer_qs_iw, rdp->cpu);
                        }
                }
-               t->rcu_read_unlock_special.b.deferred_qs = true;
                local_irq_restore(flags);
                return;
        }