rt_mutex_slowlock_block(9)
π 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β thert_mutexto 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_INTERRUPTIBLEorTASK_UNINTERRUPTIBLE. pick your fighter π₯timeoutβ the pre-initialized and started timer, orNULLfor none. so like, a timer you already set up and started, or justNULLif you're not doing timeouts, no pressure π°οΈwaiterβ the pre-initializedrt_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 thelock->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 π
- Kernel file
./kernel/locking/rtmutex.cβ__rt_mutex_slowlock(9),rtlock_slowlock_locked(9)
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
- 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