__rt_mutex_start_proxy_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 β€” the rt_mutex to take. That's the whole point, that's the vibe πŸ’–
  • waiter β€” the pre-initialized rt_mutex_waiter. Pre-initialized!! it's already dressed and ready to go, don't redo it ✨
  • task β€” the task to prepare πŸ‘‘
  • wake_q β€” the wake_q to wake tasks after we release the wait_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 πŸ‘―β€β™€οΈ:


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