Tag

optimistic spinning

1 views collected around this technical thread.

OPPO Kernel Craftsman
OPPO Kernel Craftsman
Jan 5, 2024 · Fundamentals

Read‑Write Semaphore (rw_semaphore) and Per‑CPU rwsem in the Linux Kernel (ARM64)

The article explains Linux kernel read‑write semaphores, detailing the classic rw_semaphore’s optimistic‑spinning and hand‑off mechanisms, then introduces the per‑CPU rwsem for ARM64, which replaces global counters with per‑CPU data and an RCU fast‑path to cut cache‑coherency traffic at the cost of losing optimistic spinning.

ARM64Linux kerneloptimistic spinning
0 likes · 12 min read
Read‑Write Semaphore (rw_semaphore) and Per‑CPU rwsem in the Linux Kernel (ARM64)
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.

Linux kernelSynchronizationconcurrency
0 likes · 16 min read
Understanding Linux rwsem: Mechanisms, Data Structures, and Optimistic Spinning
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Apr 22, 2022 · Fundamentals

Understanding Linux Kernel Mutex: Mechanism, Data Structures, and APIs

The Linux kernel’s mutex is a sleeping lock that serializes access by sleeping threads, enforces strict ownership rules, uses a state flag with a wait list and per‑CPU optimistic spin queue, offers APIs like mutex_init, lock, unlock and trylock, and employs handoff and MCS‑style spinning to improve performance, with OPPO’s team optimizing it to reduce UI jank.

Linux kernelSynchronizationconcurrency
0 likes · 16 min read
Understanding Linux Kernel Mutex: Mechanism, Data Structures, and APIs