for_each_console_srcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_console_srcu

okay so this is a page from the Kernel API Manual β€” yes we're literally in kernel land, get comfy 🫢

✨ NAME ✨

for_each_console_srcu β€” the lil iterator that walks over all the registered consoles πŸ‘‘

πŸŽ€ SYNOPSIS πŸŽ€

for_each_console_srcu (con );

🌸 ARGUMENTS 🌸

  • con β€” a struct console pointer that's doing double duty as your loop cursor. it's the main character of the loop, basically πŸ’«

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” SRCU does guarantee that the console list stays consistent, but ngl, the individual struct console fields? those can still get updated by other CPUs while you're mid-iteration. so like… the list is stable, the contents are lowkey moving. iykyk 😭

🚨 bestie listen: this requires console_srcu_read_lock to be held. no lock, no vibes. periodt.

the good news? it can be invoked from any context ✨ so wherever you are, you're valid.

πŸ‘‘ SEE ALSO πŸ‘‘

go off and read these next, they're all iconic in their own way πŸ’–


🌸 and that's the whole page, bestie! source lives in ./include/linux, dated October 2026, and it's the for_each_console_srcu(9) manual page ✨ slay, go iterate responsibly πŸ’…πŸ’–

πŸ“¦ where this page comes from