call_srcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… call_srcu(9) β€” like, the SRCU callback queue-er ✨

okay so bestie, welcome to the call_srcu(9) page from the Kernel API Manual β€” yes this is that kernel, and yes this function is kind of a big deal. it queues a callback for invocation after an SRCU grace period. that's the whole vibe. let's get into it 🫢


✨ SYNOPSIS ✨

void call_srcu (struct srcu_struct *ssp , struct rcu_head *rhp ,
       rcu_callback_t func );

like, three args, no return value, she's neat like that πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • ssp β€” the srcu_struct you're queueing the callback in. your home base, your safe space 🏠
  • rhp β€” the structure that gets used for queueing the SRCU callback. it's literally the queueing paperwork πŸ“‹
  • func β€” the function that gets invoked after the SRCU grace period. your main character callback πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” your callback function gets invoked some time after a full SRCU grace period elapses. and by "full SRCU grace period" we mean: after all pre-existing SRCU read-side critical sections have completed. periodt. πŸ’€

but lowkey important β€” the callback function might well execute concurrently with other SRCU read-side critical sections that started after call_srcu was invoked. so it's not like a full stop on the entire world, no cap. πŸ™ˆ

also, SRCU read-side critical sections are delimited by srcu_read_lock and srcu_read_unlock, and they may be nested. nesting is fine bestie, we love a nested critical section πŸͺ†

⚠️ okay this part matters β€” the callback will be invoked from process context, but with bh disabled. so the callback function must be fast and must not block. like do NOT be doing sleepy blocking stuff in there, that's not the move 😭

if you want the detailed info on memory ordering guarantees β€” the full essay, not the tl;dr β€” go see the description of call_rcu. that's where that lore lives πŸ“š


🌈 SEE ALSO 🌈

kernel file ./kernel/rcu/srcutree.c (iykyk πŸ‘€) plus all of these icon functions:


and that's the page, bestie! πŸŽ€βœ¨ this iconic little writeup came to you from ./kernel/rcu, dated October 2026, and it's filed under call_srcu(9). go queue a callback and slay responsibly πŸ’–πŸ¦‹

πŸ“¦ where this page comes from