1. 25 Jan, 2017 5 commits
    • Paul E. McKenney's avatar
      Merge branches 'doc.2017.01.15b', 'dyntick.2017.01.23a', 'fixes.2017.01.23a',... · 31945aa9
      Paul E. McKenney authored
      Merge branches 'doc.2017.01.15b', 'dyntick.2017.01.23a', 'fixes.2017.01.23a', 'srcu.2017.01.25a' and 'torture.2017.01.15b' into HEAD
      
      doc.2017.01.15b: Documentation updates
      dyntick.2017.01.23a: Dyntick tracking consolidation
      fixes.2017.01.23a: Miscellaneous fixes
      srcu.2017.01.25a: SRCU rewrite, fixes, and verification
      torture.2017.01.15b: Torture-test updates
      31945aa9
    • Paul E. McKenney's avatar
      srcu: Reduce probability of SRCU ->unlock_count[] counter overflow · 7f554a3d
      Paul E. McKenney authored
      Because there are no memory barriers between the srcu_flip() ->completed
      increment and the summation of the read-side ->unlock_count[] counters,
      both the compiler and the CPU can reorder the summation with the
      ->completed increment.  If the updater is preempted long enough during
      this process, the read-side counters could overflow, resulting in a
      too-short grace period.
      
      This commit therefore adds a memory barrier just after the ->completed
      increment, ensuring that if the summation misses an increment of
      ->unlock_count[] from __srcu_read_unlock(), the next __srcu_read_lock()
      will see the new value of ->completed, thus bounding the number of
      ->unlock_count[] increments that can be missed to NR_CPUS.  The actual
      overflow computation is more complex due to the possibility of nesting
      of __srcu_read_lock().
      Reported-by: default avatarLance Roy <ldr709@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      7f554a3d
    • Lance Roy's avatar
      rcutorture: Add CBMC-based formal verification for SRCU · 418b2977
      Lance Roy authored
      This commit creates a formal/srcu-cbmc directory containing scripts that
      pull SRCU in from the source code, filter it to remove things that CBMC
      cannot handle, and run a series of verifications on it.  This has a number
      of shortcomings:
      
      1.	It does not yet hook into the upper-level self-test Makefiles.
      2.	It tests only a single scenario, store buffering.
      3.	There is no gcc-based syntax-error prefiltering.
      
      Nevertheless, it does fully verify a piece of SRCU under a moderately
      weak memory model (PSO).
      Signed-off-by: default avatarLance Roy <ldr709@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      418b2977
    • Paul E. McKenney's avatar
      srcu: Force full grace-period ordering · d85b62f1
      Paul E. McKenney authored
      If a process invokes synchronize_srcu(), is delayed just the right amount
      of time, and thus does not sleep when waiting for the grace period to
      complete, there is no ordering between the end of the grace period and
      the code following the synchronize_srcu().  Similarly, there can be a
      lack of ordering between the end of the SRCU grace period and callback
      invocation.
      
      This commit adds the necessary ordering.
      Reported-by: default avatarLance Roy <ldr709@gmail.com>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      [ paulmck: Further smp_mb() adjustment per email with Lance Roy. ]
      d85b62f1
    • Lance Roy's avatar
      srcu: Implement more-efficient reader counts · f2c46896
      Lance Roy authored
      SRCU uses two per-cpu counters: a nesting counter to count the number of
      active critical sections, and a sequence counter to ensure that the nesting
      counters don't change while they are being added together in
      srcu_readers_active_idx_check().
      
      This patch instead uses per-cpu lock and unlock counters. Because both
      counters only increase and srcu_readers_active_idx_check() reads the unlock
      counter before the lock counter, this achieves the same end without having
      to increment two different counters in srcu_read_lock(). This also saves a
      smp_mb() in srcu_readers_active_idx_check().
      
      Possible bug: There is no guarantee that the lock counter won't overflow
      during srcu_readers_active_idx_check(), as there are no memory barriers
      around srcu_flip() (see comment in srcu_readers_active_idx_check() for
      details). However, this problem was already present before this patch.
      Suggested-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarLance Roy <ldr709@gmail.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Lai Jiangshan <jiangshanlai@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      f2c46896
  2. 23 Jan, 2017 21 commits
  3. 17 Jan, 2017 1 commit
  4. 16 Jan, 2017 2 commits
  5. 15 Jan, 2017 11 commits