Commit 6fedc280 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull RCU updates from Paul McKenney:

 - Miscellaneous fixes

 - Torture-test updates for smp_call_function(), most notably improved
   checking of module parameters.

 - Tasks-trace RCU updates that fix a number of rare but important
   race-condition bugs.

 - Other torture-test updates, most notably better checking of module
   parameters. In addition, rcutorture may once again be run on
   CONFIG_PREEMPT_RT kernels.

 - Torture-test scripting updates, most notably specifying the new
   CONFIG_KCSAN_STRICT kconfig option rather than maintaining an
   ever-changing list of individual KCSAN kconfig options.

* tag 'rcu.2021.11.01a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (46 commits)
  rcu: Fix rcu_dynticks_curr_cpu_in_eqs() vs noinstr
  rcu: Always inline rcu_dynticks_task*_{enter,exit}()
  torture: Make kvm-remote.sh print size of downloaded tarball
  torture: Allot 1G of memory for scftorture runs
  tools/rcu: Add an extract-stall script
  scftorture: Warn on individual scf_torture_init() error conditions
  scftorture: Count reschedule IPIs
  scftorture: Account for weight_resched when checking for all zeroes
  scftorture: Shut down if nonsensical arguments given
  scftorture: Allow zero weight to exclude an smp_call_function*() category
  rcu: Avoid unneeded function call in rcu_read_unlock()
  rcu-tasks: Update comments to cond_resched_tasks_rcu_qs()
  rcu-tasks: Fix IPI failure handling in trc_wait_for_one_reader
  rcu-tasks: Fix read-side primitives comment for call_rcu_tasks_trace
  rcu-tasks: Clarify read side section info for rcu_tasks_rude GP primitives
  rcu-tasks: Correct comparisons for CPU numbers in show_stalled_task_trace
  rcu-tasks: Correct firstreport usage in check_all_holdout_tasks_trace
  rcu-tasks: Fix s/rcu_add_holdout/trc_add_holdout/ typo in comment
  rcu-tasks: Move RTGS_WAIT_CBS to beginning of rcu_tasks_kthread() loop
  rcu-tasks: Fix s/instruction/instructions/ typo in comment
  ...
parents 79ef0c00 dd1277d2
Loading
Loading
Loading
Loading
+32 −37
Original line number Diff line number Diff line
@@ -202,49 +202,44 @@ newly arrived RCU callbacks against future grace periods:
    1 static void rcu_prepare_for_idle(void)
    2 {
    3   bool needwake;
    4   struct rcu_data *rdp;
    5   struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
    6   struct rcu_node *rnp;
    7   struct rcu_state *rsp;
    8   int tne;
    9
   10   if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL) ||
   11       rcu_is_nocb_cpu(smp_processor_id()))
   12     return;
    4   struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
    5   struct rcu_node *rnp;
    6   int tne;
    7
    8   lockdep_assert_irqs_disabled();
    9   if (rcu_rdp_is_offloaded(rdp))
   10     return;
   11
   12   /* Handle nohz enablement switches conservatively. */
   13   tne = READ_ONCE(tick_nohz_active);
   14   if (tne != rdtp->tick_nohz_enabled_snap) {
   15     if (rcu_cpu_has_callbacks(NULL))
   16       invoke_rcu_core();
   17     rdtp->tick_nohz_enabled_snap = tne;
   14   if (tne != rdp->tick_nohz_enabled_snap) {
   15     if (!rcu_segcblist_empty(&rdp->cblist))
   16       invoke_rcu_core(); /* force nohz to see update. */
   17     rdp->tick_nohz_enabled_snap = tne;
   18     return;
   19	}
   20   if (!tne)
   21     return;
   22   if (rdtp->all_lazy &&
   23       rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) {
   24     rdtp->all_lazy = false;
   25     rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted;
   26     invoke_rcu_core();
   27     return;
   28   }
   29   if (rdtp->last_accelerate == jiffies)
   30     return;
   31   rdtp->last_accelerate = jiffies;
   32   for_each_rcu_flavor(rsp) {
   33     rdp = this_cpu_ptr(rsp->rda);
   34     if (rcu_segcblist_pend_cbs(&rdp->cblist))
   35       continue;
   36     rnp = rdp->mynode;
   37     raw_spin_lock_rcu_node(rnp);
   38     needwake = rcu_accelerate_cbs(rsp, rnp, rdp);
   39     raw_spin_unlock_rcu_node(rnp);
   40     if (needwake)
   41       rcu_gp_kthread_wake(rsp);
   42   }
   43 }
   22
   23   /*
   24    * If we have not yet accelerated this jiffy, accelerate all
   25    * callbacks on this CPU.
   26   */
   27   if (rdp->last_accelerate == jiffies)
   28     return;
   29   rdp->last_accelerate = jiffies;
   30   if (rcu_segcblist_pend_cbs(&rdp->cblist)) {
   31     rnp = rdp->mynode;
   32     raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
   33     needwake = rcu_accelerate_cbs(rnp, rdp);
   34     raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */
   35     if (needwake)
   36       rcu_gp_kthread_wake();
   37   }
   38 }

But the only part of ``rcu_prepare_for_idle()`` that really matters for
this discussion are lines 37–39. We will therefore abbreviate this
this discussion are lines 32–34. We will therefore abbreviate this
function as follows:

.. kernel-figure:: rcu_node-lock.svg
+10 −0
Original line number Diff line number Diff line
@@ -96,6 +96,16 @@ warnings:
	the ``rcu_.*timer wakeup didn't happen for`` console-log message,
	which will include additional debugging information.

-	A low-level kernel issue that either fails to invoke one of the
	variants of rcu_user_enter(), rcu_user_exit(), rcu_idle_enter(),
	rcu_idle_exit(), rcu_irq_enter(), or rcu_irq_exit() on the one
	hand, or that invokes one of them too many times on the other.
	Historically, the most frequent issue has been an omission
	of either irq_enter() or irq_exit(), which in turn invoke
	rcu_irq_enter() or rcu_irq_exit(), respectively.  Building your
	kernel with CONFIG_RCU_EQS_DEBUG=y can help track down these types
	of issues, which sometimes arise in architecture-specific code.

-	A bug in the RCU implementation.

-	A hardware failure.  This is quite unlikely, but has occurred
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_RCU_TRACE=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_STACKTRACE=y
# CONFIG_RCU_CPU_STALL_INFO is not set
CONFIG_RCU_TRACE=y
# CONFIG_FTRACE is not set
# CONFIG_LD_NO_RELAX is not set
+2 −1
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ static inline void __rcu_read_lock(void)
static inline void __rcu_read_unlock(void)
{
	preempt_enable();
	if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD))
		rcu_read_unlock_strict();
}

Loading