80793c3471
Latch sequence counters are a multiversion concurrency control mechanism where the seqcount_t counter even/odd value is used to switch between two copies of protected data. This allows the seqcount_t read path to safely interrupt its write side critical section (e.g. from NMIs). Initially, latch sequence counters were implemented as a single write function above plain seqcount_t: raw_write_seqcount_latch(). The read side was expected to use plain seqcount_t raw_read_seqcount(). A specialized latch read function, raw_read_seqcount_latch(), was later added. It became the standardized way for latch read paths. Due to the dependent load, it has one read memory barrier less than the plain seqcount_t raw_read_seqcount() API. Only raw_write_seqcount_latch() and raw_read_seqcount_latch() should be used with latch sequence counters. Having *unique* read and write path APIs means that latch sequence counters are actually a data type of their own -- just inappropriately overloading plain seqcount_t. Introduce seqcount_latch_t. This adds type-safety and ensures that only the correct latch-safe APIs are to be used. Not to break bisection, let the latch APIs also accept plain seqcount_t or seqcount_raw_spinlock_t. After converting all call sites to seqcount_latch_t, only that new data type will be allowed. References: |
||
---|---|---|
.. | ||
futex-requeue-pi.rst | ||
hwspinlock.rst | ||
index.rst | ||
lockdep-design.rst | ||
lockstat.rst | ||
locktorture.rst | ||
locktypes.rst | ||
mutex-design.rst | ||
percpu-rw-semaphore.rst | ||
pi-futex.rst | ||
preempt-locking.rst | ||
robust-futex-ABI.rst | ||
robust-futexes.rst | ||
rt-mutex-design.rst | ||
rt-mutex.rst | ||
seqlock.rst | ||
spinlocks.rst | ||
ww-mutex-design.rst |