rcu_is_watching(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– rcu_is_watching(9) πŸ’–

okay so this is a page from the Kernel API Manual, and bestie, we're talking about rcu_is_watching β€” the little function that answers the big question: are RCU read-side critical sections even allowed on this CPU right now? πŸ‘€


✨ NAME ✨

rcu_is_watching β€” literally just "are RCU read-side critical sections permitted on the current CPU?" πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

notrace bool rcu_is_watching (void );

that's it. that's the whole vibe. πŸ’…


🌸 ARGUMENTS 🌸

  • void β€” no arguments, babes. zero. none. she takes nothing and she gives you a bool. iconic honestly 🫢

⭐ DESCRIPTION ⭐

so this function returns true if RCU is watching the running CPU, and false if it's not. and when it hands you a true? that means this CPU can safely enter RCU read-side critical sections. slay. πŸ’–

now, lowkey important: calls to rcu_is_watching from most parts of the kernel will return true, but there are some important exceptions you need to know about. for example, rcu_is_watching will return false if:

  • the current CPU is deep within its idle loop 😴
  • you're in kernel entry/exit code πŸšͺ
  • the CPU is offline πŸ’€

and why is it marked notrace? because it can be called by the internal functions of ftrace, and making this notrace removes unnecessary recursion calls. like, we're just being polite to the stack, fr fr. πŸ™ˆ

ngl bestie, that false return is not a suggestion β€” if this CPU isn't being watched by RCU, do not go entering read-side critical sections. respect the vibe check. βœ‹

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./kernel/rcu/tree.c β€” and oh girl, the friend group is huge, here's everybody:


and that's the whole page, bestie! 🧚 this one came to you from ./kernel/rcu, dated October 2026 β€” mwah, go forth and read-side critical section responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from