console_srcu_read_flags(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Bestie, welcome to the glow-up of console_srcu_read_flags(9) from the Kernel API Manual β€” it's giving lockless-console-flag realness and we're obsessed. πŸ’–

πŸ’– NAME πŸ’–

console_srcu_read_flags β€” locklessly read flags of a possibly registered console πŸ‘‘. That's the whole vibe: no lockless-reading erasure here, bestie.

πŸ¦‹ SYNOPSIS πŸ¦‹

Okay so the call is literally this, spacing and all:

short console_srcu_read_flags (const struct console *con );

🌸 ARGUMENTS 🌸

  • con β€” a struct console pointer of the console to read flags from. That's it, that's the argument 🫢.

✨ DESCRIPTION ✨

Locklessly reading con->flags provides a consistent read value because there is at most one CPU modifying con->flags, and that CPU is using only read-modify-write operations to do so. One modifier, read-modify-write only, consistent value β€” slay.

This one requires console_srcu_read_lock to be held, which implies that con might be a registered console. The purpose of holding console_srcu_read_lock is to guarantee that the console state is valid (CON_SUSPENDED/CON_ENABLED) and that no exit/cleanup routines will run if the console is currently undergoing unregistration. That's the safety bubble, bestie. 🫧

If the caller is holding the console_list_lock, or it is certain that con is not and will not become registered, the caller may read con->flags directly instead. Shortcut unlocked, iykyk.

πŸ”₯ CONTEXT πŸ”₯

Any context. Literally any context. 🌈

πŸŽ€ RETURN πŸŽ€

The current value of the con->flags field. That's the return value, no cap.

🌈 SEE ALSO 🌈

Kernel file ./include/linux/console.h, plus the whole reference friend group:


xoxo, bestie πŸ’… β€” this page comes from ./include/linux, dated October 2026, and it's all about console_srcu_read_flags(9). Mwah! πŸŽ€βœ¨

πŸ“¦ where this page comes from