Merge tag 'locking-urgent-2021-11-28' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 28 Nov 2021 17:04:41 +0000 (09:04 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 28 Nov 2021 17:04:41 +0000 (09:04 -0800)
commitd039f38801245ed99c0351b2259550170d7fe17b
treecea1890c9070f4edd6ac3e8811ba4cdb1499e410
parentf8132d62a2deedca1b7558028cfe72f93ad5ba2d
parent14c24048841151548a3f4d9e218510c844c1b737
Merge tag 'locking-urgent-2021-11-28' of git://git./linux/kernel/git/tip/tip

Pull locking fixes from Thomas Gleixner:
 "Two regression fixes for reader writer semaphores:

   - Plug a race in the lock handoff which is caused by inconsistency of
     the reader and writer path and can lead to corruption of the
     underlying counter.

   - down_read_trylock() is suboptimal when the lock is contended and
     multiple readers trylock concurrently. That's due to the initial
     value being read non-atomically which results in at least two
     compare exchange loops. Making the initial readout atomic reduces
     this significantly. Whith 40 readers by 11% in a benchmark which
     enforces contention on mmap_sem"

* tag 'locking-urgent-2021-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/rwsem: Optimize down_read_trylock() under highly contended case
  locking/rwsem: Make handoff bit handling more consistent