nbcon_kthread_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this page is from the Kernel API Manual (section 9, fancy), and it's all about nbcon_kthread_create β€” literally just creating a console printer thread. that's it. that's the whole vibe. πŸ’…


✨ SYNOPSIS ✨

bool nbcon_kthread_create (struct console *con );

πŸŽ€ ARGUMENTS πŸŽ€

  • con β€” the console you're operating on. that's the one. the console in question. πŸ‘‘

πŸ”₯ RETURN πŸ”₯

So it hands you back true if the kthread was started or if it already exists β€” either way, slay, you're good. πŸ’–

Otherwise it's false, and babes, listen: in that case con must not be registered. no cap. don't register it. πŸ™ˆ


🌈 DESCRIPTION 🌈

Okay so here's the tea. β˜• You call this function when you're expecting that nbcon consoles are gonna be flushed using the kthread. that's the whole point.

And the important bit: messages printed with NBCON_PRIO_NORMAL will no longer be flushed by the legacy loop. gone. retired. not their job anymore. 🫢

That's exactly why failure has to be fatal for console registration β€” like, there's no plan B here. if this doesn't work, you can't just shrug and hope the legacy loop picks up the slack, because it won't. 😭

And one more thing, super important: if con was already registered and this function fails, then con must be unregistered before the global state variable printk_kthreads_running can be set. read that again. order matters. don't skip steps. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./kernel/printk/nbcon.c, bestie β€” go read it, it's giving main character energy. and then there's the whole friend group of related functions:

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_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_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)

like. that's a lot of friends. iykyk. 🧚


alright bestie, that's the whole page β€” courtesy of ./kernel/printk, dated October 2026, and yeah it really is that old-school cool. go create some threads, you've got this. πŸ’œβœ¨

πŸ“¦ where this page comes from