nbcon_atomic_flush_pending(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nbcon_atomic_flush_pending πŸ’…

okay so this is a page from the Kernel API Manual bestie, and it's about one very specific little function in the kernel. sit down, grab a boba, we're gonna talk about flushing consoles 🫢


✨ NAME ✨

nbcon_atomic_flush_pending β€” flush all the nbcon consoles using their write_atomic() callback πŸ’–

Like, that's literally her whole job. No cap.


🌸 SYNOPSIS 🌸

void nbcon_atomic_flush_pending (void );

she takes nothing, she returns nothing, she just does the thing ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” no arguments. zero. nada. she doesn't want your parameters, she's booked and busy πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: this function flushes the backlog up through the currently newest record. Translation β€” everything that's queued up to be printed, all the way to whatever the freshest record is right now, gets pushed out. πŸ”₯

But here's the plot twist: any new records that get added while she's flushing will not be flushed, if there's another context available to handle the flushing. Why? Because otherwise one CPU would just be printing forever and ever and ever β€” unbounded 😭 β€” since the other CPUs keep adding more records and she'd never catch up. So she gracefully hands it off instead. iconic behavior honestly πŸ‘‘

lowkey this is the whole point of the function, don't sleep on it β€” the "don't flush the new ones if someone else can" rule is what keeps one CPU from getting stuck printing eternally 🫢

🌈 SEE ALSO 🌈

Kernel file ./kernel/printk/nbcon.c β€” and like, the entire nbcon extended universe, bestie. she has a LOT of siblings:

that's the whole friend group fr fr, go say hi πŸ’œ


aaaand that's the page! this one lives under ./kernel/printk and it's dated October 2026 β€” so mark your calendars bestie, she's from the future πŸ‘‘βœ¨ go touch some console output, ily, bye! πŸŽ€

πŸ“¦ where this page comes from