Skip to content

locking-urgent-2021-11-28

 - 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.
Assets 2
Loading