rcu_sync_enter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ rcu_sync_enter(9) ✨

okay so bestie, welcome to the kernel API manual, section 9 β€” today's main character is rcu_sync_enter, and she's lowkey iconic πŸ’…


πŸŽ€ NAME πŸŽ€

rcu_sync_enter β€” force readers onto the slowpath. no cap, that's literally the whole job πŸ¦‹


🌸 SYNOPSIS 🌸

void rcu_sync_enter (struct rcu_sync *rsp );

πŸ’– ARGUMENTS πŸ’–

  • rsp β€” pointer to the rcu_sync structure you're gonna use for synchronization. that's your girl, she holds the state 🫢

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: this function is for updaters β€” the ones who need readers to actually use the slowpath while an update is going down. the way that works is, once rcu_sync_enter returns, every single subsequent call to rcu_sync_is_idle comes back false, which is basically the kernel telling readers "stay off your fastpaths, we're busy" 😭✨

And then a later call to rcu_sync_exit re-enables those reader fastpaths. balance restored, periodt πŸ‘‘

Now the important bit, bestie β€” pay attention because this is the tea β˜•: when rcu_sync_enter is called in isolation, it must wait for a grace period. that's the rule, no shortcuts. however πŸ™ˆ β€” closely spaced calls to rcu_sync_enter can optimize away that grace-period wait via a state machine, and that state machine is implemented by rcu_sync_enter, rcu_sync_exit, and rcu_sync_func. teamwork makes the dream work fr fr πŸ’œ


🌈 SEE ALSO 🌈

go read those next, iykyk πŸ“šπŸ’…


and that's a wrap, bestie! πŸŽ€ this lil page comes to you from ./kernel/rcu, dated October 2026 β€” slay, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from