console_loc...le_and_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 from console_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:

  1. It’s a signal that it is no longer safe to start busy waiting for the lock.
  2. It checks if there is a busy waiter and passes the lock rights to her.
⚠️ Important: Callers lose both the console_lock and the SRCU read lock if there was a busy waiter. They must not touch items synchronized by console_lock or 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:


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