init_srcu_st..._fast_updown(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… init_srcu_st..._fast_updown(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so we're in the <pink>Kernel API Manual</pink> today and this page is literally called init_srcu_st..._fast_updown(9) (yes the name is truncated with dots, that's just how it is, no cap). Buckle up πŸ¦‹


✨ NAME ✨

init_srcu_struct_fast_updown β€” this one initializes a fast-reader up/down sleep-RCU structure. it's giving setup era, it's giving "before anything else happens, do this" πŸ‘‘


🌸 SYNOPSIS 🌸

int init_srcu_struct_fast_updown (struct srcu_struct *ssp );

like, that's the whole signature. one argument. one int coming back at you. slay πŸ’…


🫢 ARGUMENTS 🫢

  • ssp β€” the structure to initialize. that's it, that's the whole vibe. it's the thing you're setting up πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜•: use this function in place of DEFINE_SRCU_FAST_UPDOWN and DEFINE_STATIC_SRCU_FAST_UPDOWN for non-static srcu_struct structures β€” the ones that are gonna get passed to srcu_read_lock_fast_updown, srcu_down_read_fast, and friends.

and here's the part you cannot skip, bestie: it is necessary to invoke this on a given srcu_struct before passing that srcu_struct to any other function. like, any other function. no exceptions. don't be out here passing an uninitialized struct around, that's not the move 😭

each srcu_struct represents a separate domain of SRCU protection β€” so like, one struct = one domain, they're all doing their own thing, main character energy each πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./kernel/rcu/srcutree.c, plus the whole friend group:

iykyk πŸ’œ


ngl if you take one thing from this page: init first, pass second. that's the whole plot πŸ™ˆ

⭐ and that's the page!! this iconic little number lives in ./kernel/rcu, it's dated October 2026, and it answers to the name init_srcu_st..._fast_updown(9). periodt πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from