]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcu/nocb: Dump gp state even if rdp gp itself is not offloaded
authorFrederic Weisbecker <frederic@kernel.org>
Tue, 18 Mar 2025 09:23:36 +0000 (10:23 +0100)
committerNeeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
Mon, 7 Jul 2025 04:15:19 +0000 (09:45 +0530)
When a stall is detected, the state of each NOCB CPU is dumped along
with the state of each NOCB group. The latter part however is
incidentally ignored if the NOCB group leader happens not to be
offloaded itself.

Fix this to make sure related precious informations aren't lost over
a stall report.

Reported-by: "Paul E. McKenney" <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: "Paul E. McKenney" <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.upadhyay@kernel.org>
kernel/rcu/tree_nocb.h
kernel/rcu/tree_stall.h

index b473ff056f493cef9b68b9993c7b0aabd76a40d2..cb29b6bb0ed40a7c7c470f9bff89aac5dbd69764 100644 (file)
@@ -1564,6 +1564,9 @@ static void show_rcu_nocb_state(struct rcu_data *rdp)
        if (rdp->nocb_gp_rdp == rdp)
                show_rcu_nocb_gp_state(rdp);
 
+       if (!rcu_segcblist_is_offloaded(&rdp->cblist))
+               return;
+
        nocb_next_rdp = list_next_or_null_rcu(&rdp->nocb_gp_rdp->nocb_head_rdp,
                                              &rdp->nocb_entry_rdp,
                                              typeof(*rdp),
index 486c00536207d58a621ee97cf2e83834cdb186aa..4fa64c9590838f21ac46eb8ac46991d0d41fe8b2 100644 (file)
@@ -953,8 +953,7 @@ void show_rcu_gp_kthreads(void)
        for_each_possible_cpu(cpu) {
                rdp = per_cpu_ptr(&rcu_data, cpu);
                cbs += data_race(READ_ONCE(rdp->n_cbs_invoked));
-               if (rcu_segcblist_is_offloaded(&rdp->cblist))
-                       show_rcu_nocb_state(rdp);
+               show_rcu_nocb_state(rdp);
        }
        pr_info("RCU callbacks invoked since boot: %lu\n", cbs);
        show_rcu_tasks_gp_kthreads();