__rt_mutex_start_proxy_lock(9)
π
__rt_mutex_start_proxy_lock(9) β like, the Kernel API Manual page you actually want to read
okay so bestie, we're in the Kernel API Manual today and the star of the show is __rt_mutex_start_proxy_lock. Yes it has a lot of underscores. No we're not scared of it. Let's go π
β¨ NAME β¨
__rt_mutex_start_proxy_lock β Start lock acquisition for another task
Like, you're not grabbing the lock for yourself, you're doing it on behalf of somebody else. Very main character of you, honestly π«Ά
πΈ SYNOPSIS πΈ
int __rt_mutex_start_proxy_lock (struct rt_mutex_base *lock , struct
rt_mutex_waiter *waiter , struct task_struct *task , struct wake_q_head
*wake_q );
So it returns an int, and it takes four things. Four! We love a four-argument era π
π¦ ARGUMENTS π¦
lockβ thert_mutexto take. That's the whole point, that's the vibe πwaiterβ the pre-initializedrt_mutex_waiter. Pre-initialized!! it's already dressed and ready to go, don't redo it β¨taskβ the task to prepare πwake_qβ thewake_qto wake tasks after we release thewait_lock. It's giving "we'll deal with y'all in a sec" π
π DESCRIPTION π
Starts the rt_mutex acquire β so it enqueues the waiter and does the deadlock detection π΅οΈββοΈ
Important: it does not wait. If you want the waiting part, that's rt_mutex_wait_proxy_lock, a whole different girlie. Don't @ me π
This is a special API call for PI-futex support. iykyk β¨
π NOTE π
This one's serious, so listen up:
It does NOT remove the waiter on failure. Like, at all. Zero cleanup, none, nada. π¨
So after you call this, you must call either rt_mutex_wait_proxy_lock or rt_mutex_cleanup_proxy_lock. Those are your only two options, bestie. Pick one, fr fr π
π RETURN π
0β task blocked on lock π΄1β acquired the lock for the task, and the caller should wake it up βοΈ (yes, that's you)<0β error π₯
π§ SEE ALSO π§
First things first, the kernel file: ./kernel/locking/rtmutex_api.c π
And then the whole friend group π―ββοΈ:
rt_mutex_lock_nested(9)rt_mutex_lock(9)rt_mutex_lock_interruptible(9)rt_mutex_lock_killable(9)rt_mutex_trylock(9)rt_mutex_unlock(9)__rt_mutex_futex_unlock(9)__rt_mutex_init(9)rt_mutex_init_proxy_locked(9)rt_mutex_proxy_unlock(9)rt_mutex_start_proxy_lock(9)rt_mutex_wait_proxy_lock(9)rt_mutex_cleanup_proxy_lock(9)
and that's the whole page, bestie! πβ¨ππ¦
cute little sign-off: this one lives under ./kernel/locking and it's dated October 2026 π
β go forth and proxy-lock responsibly, ok? love u, bye ππ
π¦ 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