srcu_down_read(9)
π NAME π
okay bestie, welcome to the srcu_down_read(9) page from the Kernel API Manual π this one is short, sweet, and very real:
srcu_down_readβ register a new reader for an SRCU-protected structure. π«Ά
β¨ SYNOPSIS β¨
int srcu_down_read (struct srcu_struct *ssp );
π ARGUMENTS π
sspβ thesrcu_structin which to register the new reader. π
π¦ DESCRIPTION π¦
This call enters a semaphore-like SRCU read-side critical section. And yes, SRCU read-side critical sections may be nested. πΈ
bestie, the big no-no: it is illegal to call anything that waits on an SRCU grace period for the same srcu_struct, whether directly or indirectly. π
One way to indirectly wait on an SRCU grace period is to acquire a mutex that is held elsewhere while calling synchronize_srcu or synchronize_srcu_expedited. But if you want lockdep to help you keep this stuff straight, you should instead use srcu_read_lock. π
The semaphore-like nature of srcu_down_read means that the matching srcu_up_read can be invoked from some other context β for example, from some other task or from an irq handler. π¦ However, neither srcu_down_read nor srcu_up_read may be invoked from an NMI handler. π« no NMI vibes, periodt.
Calls to srcu_down_read may be nested, similar to the manner in which calls to down_read may be nested. The same srcu_struct may be used concurrently by srcu_down_read and srcu_read_lock. β¨
π SEE ALSO π
Kernel file ./include/linux/srcu.h β and the whole squad is:
get_completed_synchronize_srcu(9)same_state_synchronize_srcu(9)srcu_read_lock_held(9)srcu_dereference_check(9)srcu_dereference(9)srcu_dereference_notrace(9)srcu_read_lock(9)srcu_read_lock_fast(9)srcu_read_lock_fast_updown(9)srcu_down_read_fast(9)srcu_read_lock_nmisafe(9)srcu_read_unlock(9)srcu_read_unlock_fast(9)srcu_read_unlock_fast_updown(9)srcu_up_read_fast(9)srcu_read_unlock_nmisafe(9)srcu_up_read(9)smp_mb__after_srcu_read_unlock(9)smp_mb__after_srcu_read_lock(9)
okurrr, that's the whole srcu_down_read(9) page β source/version ./include/linux, dated October 2026. go forth and register those readers, bestie ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms