1. 30 Oct, 2019 20 commits
  2. 29 Oct, 2019 9 commits
  3. 28 Oct, 2019 5 commits
    • Paul E. McKenney's avatar
      rcu: Make kernel-mode nohz_full CPUs invoke the RCU core processing · dd7dafd1
      Paul E. McKenney authored
      If a nohz_full CPU is idle or executing in userspace, it makes good sense
      to keep it out of RCU core processing.  After all, the RCU grace-period
      kthread can see its quiescent states and all of its callbacks are
      offloaded, so there is nothing for RCU core processing to do.
      
      However, if a nohz_full CPU is executing in kernel space, the RCU
      grace-period kthread cannot do anything for it, so such a CPU must report
      its own quiescent states.  This commit therefore makes nohz_full CPUs
      skip RCU core processing only if the scheduler-clock interrupt caught
      them in idle or in userspace.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      dd7dafd1
    • Paul E. McKenney's avatar
      rcu: Confine ->core_needs_qs accesses to the corresponding CPU · ed93dfc6
      Paul E. McKenney authored
      Commit 671a6351 ("rcu: Avoid unnecessary softirq when system
      is idle") fixed a bug that could result in an indefinite number of
      unnecessary invocations of the RCU_SOFTIRQ handler at the trailing edge
      of a scheduler-clock interrupt.  However, the fix introduced off-CPU
      stores to ->core_needs_qs.  These writes did not conflict with the
      on-CPU stores because the CPU's leaf rcu_node structure's ->lock was
      held across all such stores.  However, the loads from ->core_needs_qs
      were not promoted to READ_ONCE() and, worse yet, the code loading from
      ->core_needs_qs was written assuming that it was only ever updated by
      the corresponding CPU.  So operation has been robust, but only by luck.
      This situation is therefore an accident waiting to happen.
      
      This commit therefore takes a different approach.  Instead of clearing
      ->core_needs_qs from the grace-period kthread's force-quiescent-state
      processing, it modifies the rcu_pending() function to suppress the
      rcu_sched_clock_irq() function's call to invoke_rcu_core() if there is no
      grace period in progress.  This avoids the infinite needless RCU_SOFTIRQ
      handlers while still keeping all accesses to ->core_needs_qs local to
      the corresponding CPU.
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      ed93dfc6
    • Joel Fernandes (Google)'s avatar
      rcu: Reset CPU hints when reporting a quiescent state · 516e5ae0
      Joel Fernandes (Google) authored
      In some cases, tracing shows that need_heavy_qs is still set even though
      urgent_qs was cleared upon reporting of a quiescent state.  One such
      case is when the softirq reports that a CPU has passed quiescent state.
      
      Commit 671a6351 ("rcu: Avoid unnecessary softirq when system is
      idle") fixed a bug where core_needs_qs was not being cleared.  In order
      to avoid running into similar situations with the urgent-grace-period
      flags, this commit causes rcu_disable_urgency_upon_qs(), previously
      rcu_disable_tick_upon_qs(), to clear the urgency hints, ->rcu_urgent_qs
      and ->rcu_need_heavy_qs.  Note that it is possible for CPUs to go
      offline with these urgency hints still set.  This is handled because
      rcu_disable_urgency_upon_qs() is also invoked during the online process.
      
      Because these hints can be cleared both by the corresponding CPU and by
      the grace-period kthread, this commit also adds a number of READ_ONCE()
      and WRITE_ONCE() calls.
      
      Tested overnight with rcutorture running for 60 minutes on all
      configurations of RCU.
      Signed-off-by: default avatar"Joel Fernandes (Google)" <joel@joelfernandes.org>
      [ paulmck: Clear urgency flags in rcu_disable_urgency_upon_qs(). ]
      [ paulmck: Remove ->core_needs_qs from the set cleared at quiescent state. ]
      [ paulmck: Make rcu_disable_urgency_upon_qs static per kbuild test robot. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      516e5ae0
    • Paul E. McKenney's avatar
      rcu: Force nohz_full tick on upon irq enter instead of exit · b200a048
      Paul E. McKenney authored
      There is interrupt-exit code that forces on the tick for nohz_full CPUs
      failing to respond to the current grace period in a timely fashion.
      However, this code must compare ->dynticks_nmi_nesting to the value 2
      in the interrupt-exit fastpath.  This commit therefore moves this code
      to the interrupt-entry fastpath, where a lighter-weight comparison to
      zero may be used.
      Reported-by: default avatarJoel Fernandes <joel@joelfernandes.org>
      [ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU->TICK_DEP_BIT_RCU fix. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      b200a048
    • Paul E. McKenney's avatar
      rcu: Force tick on for nohz_full CPUs not reaching quiescent states · 66e4c33b
      Paul E. McKenney authored
      CPUs running for long time periods in the kernel in nohz_full mode
      might leave the scheduling-clock interrupt disabled for then full
      duration of their in-kernel execution.  This can (among other things)
      delay grace periods.  This commit therefore forces the tick back on
      for any nohz_full CPU that is failing to pass through a quiescent state
      upon return from interrupt, which the resched_cpu() will induce.
      Reported-by: default avatarJoel Fernandes <joel@joelfernandes.org>
      [ paulmck: Clear ->rcu_forced_tick as reported by Joel Fernandes testing. ]
      [ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU->TICK_DEP_BIT_RCU fix. ]
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      66e4c33b
  4. 05 Oct, 2019 6 commits