1. 03 Sep, 2020 4 commits
    • Paul E. McKenney's avatar
      Merge branch 'scftorture.2020.08.24a' into HEAD · f511ce14
      Paul E. McKenney authored
      scftorture.2020.08.24a: Torture tests for smp_call_function() and friends.
      f511ce14
    • Paul E. McKenney's avatar
      Merge branches 'doc.2020.08.24a', 'fixes.2020.09.03b' and 'torture.2020.08.24a' into HEAD · cfb2c107
      Paul E. McKenney authored
      doc.2020.08.24a: Documentation updates.
      fixes.2020.09.03b: Miscellaneous fixes.
      torture.2020.08.24a: Torture-test updates.
      cfb2c107
    • Zqiang's avatar
      rcu: Shrink each possible cpu krcp · 70060b87
      Zqiang authored
      CPUs can go offline shortly after kfree_call_rcu() has been invoked,
      which can leave memory stranded until those CPUs come back online.
      This commit therefore drains the kcrp of each CPU, not just the
      ones that happen to be online.
      Acked-by: default avatarJoel Fernandes <joel@joelfernandes.org>
      Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      70060b87
    • Joel Fernandes (Google)'s avatar
      rcu/segcblist: Prevent useless GP start if no CBs to accelerate · 53922270
      Joel Fernandes (Google) authored
      The rcu_segcblist_accelerate() function returns true iff it is necessary
      to request another grace period.  A tracing session showed that this
      function unnecessarily requests grace periods.
      
      For example, consider the following sequence of events:
      1. Callbacks are queued only on the NEXT segment of CPU A's callback list.
      2. CPU A runs RCU_SOFTIRQ, accelerating these callbacks from NEXT to WAIT.
      3. Thus rcu_segcblist_accelerate() returns true, requesting grace period N.
      4. RCU's grace-period kthread wakes up on CPU B and starts grace period N.
      4. CPU A notices the new grace period and invokes RCU_SOFTIRQ.
      5. CPU A's RCU_SOFTIRQ again invokes rcu_segcblist_accelerate(), but
         there are no new callbacks.  However, rcu_segcblist_accelerate()
         nevertheless (uselessly) requests a new grace period N+1.
      
      This extra grace period results in additional lock contention and also
      additional wakeups, all for no good reason.
      
      This commit therefore adds a check to rcu_segcblist_accelerate() that
      prevents the return of true when there are no new callbacks.
      
      This change reduces the number of grace periods (GPs) and wakeups in each
      of eleven five-second rcutorture runs as follows:
      
      +----+-------------------+-------------------+
      | #  | Number of GPs     | Number of Wakeups |
      +====+=========+=========+=========+=========+
      | 1  | With    | Without | With    | Without |
      +----+---------+---------+---------+---------+
      | 2  |      75 |      89 |     113 |     119 |
      +----+---------+---------+---------+---------+
      | 3  |      62 |      91 |     105 |     123 |
      +----+---------+---------+---------+---------+
      | 4  |      60 |      79 |      98 |     110 |
      +----+---------+---------+---------+---------+
      | 5  |      63 |      79 |      99 |     112 |
      +----+---------+---------+---------+---------+
      | 6  |      57 |      89 |      96 |     123 |
      +----+---------+---------+---------+---------+
      | 7  |      64 |      85 |      97 |     118 |
      +----+---------+---------+---------+---------+
      | 8  |      58 |      83 |      98 |     113 |
      +----+---------+---------+---------+---------+
      | 9  |      57 |      77 |      89 |     104 |
      +----+---------+---------+---------+---------+
      | 10 |      66 |      82 |      98 |     119 |
      +----+---------+---------+---------+---------+
      | 11 |      52 |      82 |      83 |     117 |
      +----+---------+---------+---------+---------+
      
      The reduction in the number of wakeups ranges from 5% to 40%.
      
      Cc: urezki@gmail.com
      [ paulmck: Rework commit log and comment. ]
      Signed-off-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      53922270
  2. 25 Aug, 2020 36 commits