nbcon_atomic_flush_pending(9)
π 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:
nbcon_state_set(9)nbcon_state_read(9)nbcon_state_try_cmpxchg(9)nbcon_seq_read(9)nbcon_seq_force(9)nbcon_seq_try_update(9)nbcon_context_try_acquire_direct(9)nbcon_context_try_acquire_requested(9)nbcon_context_try_acquire_handover(9)nbcon_context_try_acquire_hostile(9)nbcon_context_try_acquire(9)nbcon_context_release(9)nbcon_context_can_proceed(9)nbcon_can_proceed(9)__nbcon_context_update_unsafe(9)nbcon_enter_unsafe(9)nbcon_exit_unsafe(9)nbcon_reacquire_nobuf(9)nbcon_emit_next_record(9)nbcon_kthread_should_wakeup(9)nbcon_kthread_func(9)nbcon_irq_work(9)nbcon_kthreads_wake(9)nbcon_kthread_create(9)nbcon_get_cpu_emergency_nesting(9)nbcon_get_default_prio(9)nbcon_allow_unsafe_takeover(9)nbcon_legacy_emit_next_record(9)__nbcon_atomic_flush_pending_con(9)nbcon_atomic_flush_pending_con(9)__nbcon_atomic_flush_pending(9)nbcon_atomic_flush_unsafe(9)nbcon_cpu_emergency_enter(9)nbcon_cpu_emergency_exit(9)nbcon_alloc(9)nbcon_free(9)nbcon_device_try_acquire(9)nbcon_device_release(9)nbcon_kdb_try_acquire(9)nbcon_kdb_release(9)nbcon_write_context_is_braille(9)nbcon_braille_try_acquire(9)nbcon_braille_release(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms