rcu_read_lock_sched(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rcu_read_lock_sched β€” a Kernel API Manual moment πŸ’…

okay so bestie, welcome to rcu_read_lock_sched(9) from the Kernel API Manual. this is the page, and it's giving "small but mighty" ✨ let's get into it πŸŽ€


🌸 NAME 🌸

rcu_read_lock_sched β€” mark the beginning of a RCU-sched critical section

like, it's literally the "start here" flag for an RCU-sched critical section, no cap πŸ’–


✨ SYNOPSIS ✨

void rcu_read_lock_sched (void );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • void β€” no arguments. that's it. nothing. zero. the void is voiding πŸ™ˆ

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• β€” this is equivalent to rcu_read_lock, but it also disables preemption. two-for-one behavior, iconic.

read-side critical sections can also be introduced by anything else that disables preemption, including local_irq_disable and friends. so like, there's more than one way into the party πŸŽ‰ but heads up, bestie:

🚨 important caveat incoming 🚨 β€” the equivalence to rcu_read_lock applies only to v5.0 and later. before v5.0, rcu_read_lock and rcu_read_lock_sched were unrelated. like, total strangers. not even mutuals. 😭

and another thing, and this one is fr fr serious: rcu_read_lock_sched and the matching rcu_read_unlock_sched must occur in the same context. for example, it is illegal to invoke rcu_read_unlock_sched from process context if the matching rcu_read_lock_sched was invoked from an NMI handler. πŸ’€ not "illegal" like a warning, like genuinely not allowed. keep the pair together, they're a set, don't split them up 🫢


🌈 SEE ALSO 🌈

the whole friend group πŸ’œ β€” kernel file ./include/linux/rcupdate.h plus:


and that's the whole page, bestie, you ate that πŸ“ mwah πŸ’‹

sign-off time ✨ this iconic little page lives in ./include/linux and the version/date on the tin is October 2026, page name rcu_read_lock_sched(9). go forth and lock sched-ly πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from