nbcon_context_can_proceed(9)
π nbcon_context_can_proceed(9) β¨
Okay bestie, welcome to the Kernel API Manual β this one's a little function with big main character energy, and honestly it's giving "am I still the lock owner or not" vibes. Let's get into it π
πΈ NAME πΈ
nbcon_context_can_proceed β check whether ownership can proceed π«Ά
β¨ SYNOPSIS β¨
bool nbcon_context_can_proceed (struct nbcon_context *ctxt , struct
nbcon_state *cur );
π¦ ARGUMENTS π¦
ctxtβ the nbcon context you got fromnbcon_context_try_acquireπcurβ the current console state, like, right now π
π RETURN π
Returns True if this context still owns the console. Returns False if ownership was handed over or taken β i.e. somebody else is main character now π
π₯ DESCRIPTION π₯
Okay so, real talk: you must invoke this when you're entering the unsafe state, so you can make sure it still owns the lock. No cap. π
You also must invoke it when you're exiting the unsafe context, so the lock can eventually be freed for a higher priority context that asked for the friendly handover. Be nice, share the console π«Ά
It can be called inside an unsafe section when the console is just temporary in safe state, instead of exiting and entering the unsafe state. Convenient, honestly β¨
It can also be called in the safe context before doing an expensive safe operation. Like, why would you do the operation when a higher priority context took the lock? That'd be such a waste, ngl π₯²
β οΈ BIG ONE, bestie: when this function returns false, the calling context no longer owns the console and is no longer allowed to go forward. Periodt. In this case it must back out immediately and carefully π The buffer content is also no longer trusted, since it no longer belongs to the calling context. Do not touch. Do not trust. Back away slowly π
π SEE ALSO π
Kernel file ./kernel/printk/nbcon.c β and the whole friend group:
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_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_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)
And that's the whole thing, bestie π§ This page lives under ./kernel/printk, dated October 2026 β slay, go forth and check your ownership before you proceed ππ
π¦ 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