rt_mutex_slowlock_block(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rt_mutex_slowlock_block πŸ’…

okay bestie, so this one lives in the Kernel API Manual and it's literally the whole wait-wake-try-to-take loop in one little function πŸŽ€ β€” like the entire "okay I'll nap, wait, actually let me try grabbing it again" cycle. Iconic behavior, honestly.


✨ SYNOPSIS ✨

int rt_mutex_slowlock_block (struct rt_mutex_base *lock , struct
ww_acquire_ctx *ww_ctx , unsigned int state , struct hrtimer_sleeper
*timeout , struct rt_mutex_waiter *waiter , struct wake_q_head *wake_q
);

no cap, six arguments, and every single one of them matters β€” let's get into it 🫢


🌸 ARGUMENTS 🌸

  • lock β€” the rt_mutex to take. that's the whole goal here, we want it, we're getting it πŸ’…
  • ww_ctx β€” the WW mutex context pointer. yes, WW like wound/wait. keep up ✨
  • state β€” the state the task should block in, and it's one of exactly two: TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE. pick your fighter πŸ₯Š
  • timeout β€” the pre-initialized and started timer, or NULL for none. so like, a timer you already set up and started, or just NULL if you're not doing timeouts, no pressure πŸ•°οΈ
  • waiter β€” the pre-initialized rt_mutex_waiter. pre-initialized, bestie, don't come in here with an uninitialized one 😭
  • waiter... no wait β€” wake_q β€” wake_q of tasks to wake when we drop the lock->wait_lock. that's the whole point of it, it's the little to-wake list πŸ“‹πŸ’–

πŸ”₯ DESCRIPTION πŸ”₯

Must be called with lock->wait_lock held and interrupts disabled.

🚨 that's not a suggestion, that's the law. lock->wait_lock held, interrupts disabled. periodt. do it any other way and you're on your own, iykyk πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

go read those next, they're literally right there in the same file, main character energy all around 🌈⭐


alright babe, that's the page β€” brought to you by ./kernel/locking, dated October 2026, filed under rt_mutex_slowlock_block(9) πŸ¦‹πŸ’œ now go hold that lock and disable those interrupts, mwah πŸŽ€

πŸ“¦ where this page comes from