nbcon_kdb_try_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nbcon_kdb_try_acquire β€” like, the kernel-api-manual moment of the day ✨

okay so bestie, this is the nbcon_kdb_try_acquire(9) page from the Kernel API Manual, and it's giving "tiny function, big responsibilities" energy. Let's get into it 🫢


🌸 NAME 🌸

nbcon_kdb_try_acquire β€” literally tries to acquire the nbcon console and then enter the unsafe section. That's the whole vibe. No cap.


✨ SYNOPSIS ✨

bool nbcon_kdb_try_acquire (struct console *con , struct
       nbcon_write_context *wctxt );

(it returns a bool, in case you were wondering β€” spoiler: it's not always true πŸ‘€)


πŸŽ€ ARGUMENTS πŸŽ€

  • con β€” the nbcon console you're trying to acquire. like, the one. the main character console πŸ‘‘
  • wctxt β€” the nbcon write context that gets used if it works out (i.e. on success πŸ’–)

πŸ¦‹ CONTEXT πŸ¦‹

Under console_srcu_read_lock for emitting a single kdb message using the given con->write_atomic callback. And listen β€” you can only call this when the console is usable at the moment. That's the vibe check, and you gotta pass it first βœ‹


πŸ’€ RETURN πŸ’€

Returns true if the console was acquired. false otherwise. that's it, that's the whole drama πŸ™ˆ


πŸ”₯ DESCRIPTION πŸ”₯

So kdb emits messages on consoles that are registered for printk without storing them into the ring buffer. Which means β€” plot twist β€” it has to acquire console ownership so that it can call the con->write_atomic callback in a safe way. iconic behaviour, honestly.

This function acquires the nbcon console using priority NBCON_PRIO_EMERGENCY and marks it unsafe for handover/takeover. yes bestie, emergency priority AND unsafe-for-handover. it's doing the most πŸ’…


🌈 SEE ALSO 🌈

Kernel file ./kernel/printk/nbcon.c, plus the whole friend group:


okay that's the whole page, you ate it up bestie πŸ“ mwah πŸ’œ

sign-off time: this lil cutie lives in ./kernel/printk and it's dated October 2026 ⭐ slay, see you in the next manpage 🧚

πŸ“¦ where this page comes from