hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/kernel/rcu/tree_exp.h
....@@ -507,7 +507,10 @@
507507 if (rdp->rcu_forced_tick_exp)
508508 continue;
509509 rdp->rcu_forced_tick_exp = true;
510
- tick_dep_set_cpu(cpu, TICK_DEP_BIT_RCU_EXP);
510
+ preempt_disable();
511
+ if (cpu_online(cpu))
512
+ tick_dep_set_cpu(cpu, TICK_DEP_BIT_RCU_EXP);
513
+ preempt_enable();
511514 }
512515 }
513516 j = READ_ONCE(jiffies_till_first_fqs);
....@@ -565,7 +568,9 @@
565568 mask = leaf_node_cpu_bit(rnp, cpu);
566569 if (!(READ_ONCE(rnp->expmask) & mask))
567570 continue;
571
+ preempt_disable(); // For smp_processor_id() in dump_cpu_task().
568572 dump_cpu_task(cpu);
573
+ preempt_enable();
569574 }
570575 }
571576 jiffies_stall = 3 * rcu_jiffies_till_stall_check() + 3;
....@@ -706,9 +711,11 @@
706711 int ndetected = 0;
707712 struct task_struct *t;
708713
709
- if (!READ_ONCE(rnp->exp_tasks))
710
- return 0;
711714 raw_spin_lock_irqsave_rcu_node(rnp, flags);
715
+ if (!rnp->exp_tasks) {
716
+ raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
717
+ return 0;
718
+ }
712719 t = list_entry(rnp->exp_tasks->prev,
713720 struct task_struct, rcu_node_entry);
714721 list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) {