Tag

rwsem

1 views collected around this technical thread.

OPPO Kernel Craftsman
OPPO Kernel Craftsman
May 26, 2023 · Fundamentals

Understanding Linux rwsem Read‑Write Semaphore in Kernel 5.15.81

Linux introduced the read‑write semaphore (rwsem) as a sleep lock that lets multiple readers hold the lock concurrently, improving read‑heavy workload performance, and the article details its internal state representation, acquisition paths for reads and writes, optimistic spinning, handoff mechanisms, and trade‑offs, noting that mobile kernels may need further tuning.

ConcurrencyLinux kernelSynchronization
0 likes · 22 min read
Understanding Linux rwsem Read‑Write Semaphore in Kernel 5.15.81
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Aug 12, 2022 · Fundamentals

Understanding Linux rwsem: Mechanisms, Data Structures, and Optimistic Spinning

Linux rwsem is a read‑write semaphore that lets multiple readers or a single writer hold the lock, using a count field, owner pointer, optimistic‑spin queue (osq), and protected wait list; it provides fast, medium, and slow acquisition paths with handoff and optimistic spinning to reduce sleep latency compared to mutexes and spinlocks.

ConcurrencyLinux kernelSynchronization
0 likes · 16 min read
Understanding Linux rwsem: Mechanisms, Data Structures, and Optimistic Spinning