srcu_read_lock_fast_updown(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… srcu_read_lock_fast_updown(9) β€” the Kernel API Manual, bestie edition πŸ’…

Okay so we're in the Kernel API Manual today, and the whole entire main character of this page is srcu_read_lock_fast_updown. Yes the name is a mouthful, no we are not abbreviating it, she earned every syllable. πŸŽ€


✨ NAME ✨

srcu_read_lock_fast_updown β€” register a new reader for an SRCU-fast-updown structure. That's it, that's the job, and she does it flawlessly. πŸ¦‹


🌸 SYNOPSIS 🌸

struct srcu_ctr __percpu * srcu_read_lock_fast_updown (struct
srcu_struct *ssp );

Not me typing __percpu with a straight face. Iconic signature, no notes. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • ssp β€” the srcu_struct you're registering your shiny new reader in. That's the one. That's the whole argument. 🫢

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: you're entering an SRCU read-side critical section, but make it the light-weight version β€” specifically for an smp_mb-free reader. If you want the full lore, go check srcu_read_lock, she explains everything. This function is compatible with srcu_down_read_fast, but bestie, hear me β€” it is not NMI-safe. Not even a little. 😭

Now for the rules, because there are always rules:

For srcu_read_lock_fast_updown to be used on an srcu_struct structure, that structure has to have been defined one of two ways:

  • using DEFINE_SRCU_FAST_UPDOWN, or
  • using DEFINE_STATIC_SRCU_FAST_UPDOWN,

or, on the other hand, it must have been initialized with init_srcu_struct_fast_updown.

That's non-negotiable. A structure like that cannot be passed to any non-fast-updown variant of srcu_read_{,un}lock or srcu_{down,up}_read. Associated, not interchangeable, iykyk. And in kernels built with CONFIG_PROVE_RCU=y, __srcu_check_read_flavor will complain bitterly if you ignore this * restriction. Bitterly. You've been warned. πŸ’€

Also slay while knowing this: grace-period auto-expediting is disabled for SRCU-fast-updown srcu_struct structures. The reason is that SRCU-fast-updown expedited grace periods invoke synchronize_rcu_expedited, IPIs and all. So if you truly need expedited SRCU-fast-updown grace periods, use synchronize_srcu_expedited. Simple as that. ⭐

And one more vibe check: srcu_read_lock_fast_updown can be invoked only from those contexts where RCU is watching β€” like, the contexts where it would be legal to invoke rcu_read_lock. Wander outside that and lockdep will complain. Loudly. πŸ™ˆ

No cap: wrong flavor of srcu_struct, wrong context, or an NMI, and the kernel will be giving you a look. πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/srcu.h, plus the whole friend group:


Okay that's the whole page, mwah. πŸ’‹ This little masterpiece lives in ./include/linux, dated October 2026, and it answers to srcu_read_lock_fast_updown(9) β€” remember her name, she's going places. πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from