console_forc...erred_locked(9)
π console_force_preferred_locked(9) β the Kernel API Manual, but make it make sense
okay so bestie, welcome to the glow-up edition of the console_forc...erred_locked(9) page from the Kernel API Manual β¨ this is a lil function that lets you force a registered console to be the preferred one, and honestly? it's giving main character energy for your console list. let's get into it π
πΈ NAME
console_force_preferred_locked β force a registered console preferred π
β¨ SYNOPSIS
void console_force_preferred_locked (struct console *con );
that's it, that's the whole signature, no cap π
π¦ ARGUMENTS
conβ the registered console you wanna force preferred. it's already registered, okay? we're not out here registering anything, just picking a favorite π«Ά
π₯ DESCRIPTION
β οΈ Must be called under console_list_lock.
like, literally mandatory. you gotta be holding console_list_lock when you call this, no exceptions, periodt. don't just vibe in there unlocked, that's how you get crashes and we are NOT about that life ππ
π SEE ALSO
okay this is the part where I list every single friend in the printk group chat, and there are a LOT, so buckle up babes π
- Kernel file
./kernel/printk/printk.c console_list_lock(9),console_list_unlock(9)console_srcu_read_lock(9),console_srcu_read_unlock(9)console_lock_spinning_enable(9),console_lock_spinning_disable_and_check(9),console_trylock_spinning(9)printk_parse_prefix(9)add_preferred_console(9),match_devname_and_update_preferred_console(9)console_suspend_all(9),console_cpu_notify(9)console_lock(9),console_trylock(9),console_unlock(9)console_flush_on_panic(9)printk_kthreads_shutdown(9)pr_flush(9),wake_up_klogd(9),defer_console_output(9),printk_trigger_flush(9),printk_timed_ratelimit(9)kmsg_dump_register(9),kmsg_dump_unregister(9),kmsg_dump_desc(9),kmsg_dump_get_line(9),kmsg_dump_get_buffer(9),kmsg_dump_rewind(9)console_try_replay_all(9)__printk_cpu_sync_wait(9),__printk_cpu_sync_try_get(9),__printk_cpu_sync_put(9)
like I said β the whole friend group, every single one, accounted for πβ¨
and that's the page, bestie! this lil rewrite comes to you from ./kernel/printk, dated October 2026, and yes the original title is still console_forc...erred_locked(9) β truncated and all, we respect the aesthetic π
π
π¦ 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