rcu_sync_func(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay bestie, welcome to the rcu_sync_func(9) page from the Kernel API Manual πŸ’– this one is literally the callback function managing reader access to fastpath β€” that's the whole vibe. no cap.

✨ SYNOPSIS ✨

void rcu_sync_func (struct rcu_head *rhp );

πŸŽ€ ARGUMENTS πŸŽ€

  • rhp β€” Pointer to rcu_head in rcu_sync structure to use for synchronization 🫢

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: rcu_sync_enter and rcu_sync_exit pass this function to call_rcu, so it gets invoked after a grace period following that invocation of enter/exit ✨

if it's called by rcu_sync_enter, it signals that all the readers were switched onto slow path 🐒

if it's called by rcu_sync_exit, it takes action based on events that have taken place in the meantime, so that closely spaced rcu_sync_enter and rcu_sync_exit pairs need not wait for a grace period πŸ‘‘

if another rcu_sync_enter is invoked before the grace period ended, reset state to allow the next rcu_sync_exit to let the readers back onto their fastpaths (after a grace period) πŸƒβ€β™€οΈπŸ’¨

if both another rcu_sync_enter and its matching rcu_sync_exit are invoked before the grace period ended, re-invoke call_rcu on behalf of that rcu_sync_exit πŸ”

otherwise, set all state back to idle so that readers can again use their fastpaths 🌈

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./kernel/rcu/sync.c β€” and go read rcu_sync_init(9), rcu_sync_enter(9), rcu_sync_exit(9), and rcu_sync_dtor(9) too, iykyk πŸ’œ


mwah πŸ’‹ that's the whole page, bestie β€” source/version ./kernel/rcu, dated October 2026, rcu_sync_func(9) 🫢✨

πŸ“¦ where this page comes from