console_loc...le_and_check(9)
π NAME π
okay bestie, meet console_lock_spinning_disable_and_check β yes, the whole mouthful β from the Kernel API Manual. Its whole deal is to mark the end of code where another thread was able to busy wait, and check if there is a waiter. Thatβs the assignment. π«Ά
π₯ SYNOPSIS π₯
int console_lock_spinning_disable_and_check (int cookie );
π ARGUMENTS π
cookieβ the cookie returned fromconsole_srcu_read_lock.
β¨ DESCRIPTION β¨
So this gets called at the end of the section where spinning is allowed. It has two functions, and no we are not skipping either one:
- Itβs a signal that it is no longer safe to start busy waiting for the lock.
- It checks if there is a busy waiter and passes the lock rights to her.
β οΈ Important: Callers lose both theconsole_lockand the SRCU read lock if there was a busy waiter. They must not touch items synchronized byconsole_lockor SRCU read lock in this case. Like, do not touch. Not even a little. π
π RETURN π
1 if the lock rights were passed, 0 otherwise. Thatβs the whole vibe check. β
π SEE ALSO π
Kernel file: ./kernel/printk/printk.c.
The whole (9) squad:
console_list_lock(9)console_list_unlock(9)console_srcu_read_lock(9)console_srcu_read_unlock(9)console_lock_spinning_enable(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)console_force_preferred_locked(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)
okay thatβs the page, bestie! π source/version: ./kernel/printk Β· date: October 2026 Β· manual: Kernel API Manual Β· page: console_lock_spinning_disable_and_check(9). byeee πβ¨
π¦ 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