mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
91710728d1
preempt_disable() and local_irq_disable/save() are in principle per CPU big
kernel locks. This has several downsides:
- The protection scope is unknown
- Violation of protection rules is hard to detect by instrumentation
- For PREEMPT_RT such sections, unless in low level critical code, can
violate the preemptability constraints.
To address this PREEMPT_RT introduced the concept of local_locks which are
strictly per CPU.
The lock operations map to preempt_disable(), local_irq_disable/save() and
the enabling counterparts on non RT enabled kernels.
If lockdep is enabled local locks gain a lock map which tracks the usage
context. This will catch cases where an area is protected by
preempt_disable() but the access also happens from interrupt context. local
locks have identified quite a few such issues over the years, the most
recent example is:
|
||
---|---|---|
.. | ||
index.rst | ||
lockdep-design.rst | ||
lockstat.rst | ||
locktorture.rst | ||
locktypes.rst | ||
mutex-design.rst | ||
rt-mutex-design.rst | ||
rt-mutex.rst | ||
spinlocks.rst | ||
ww-mutex-design.rst |