call_srcu(9)
π 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β thesrcu_structyou'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:
init_srcu_struct_generic(9)init_srcu_struct_fast(9)init_srcu_struct_fast_updown(9)cleanup_srcu_struct(9)synchronize_srcu_expedited(9)synchronize_srcu(9)get_state_synchronize_srcu(9)start_poll_synchronize_srcu(9)poll_state_synchronize_srcu(9)srcu_barrier(9)srcu_expedite_current(9)srcu_batches_completed(9)
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
- 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