ww_mutex_unlock(9)
β¨ ww_mutex_unlock π
okay so bestie, we're in the Kernel API Manual today and the star of the show is ww_mutex_unlock β yes, the w/w mutex release function, and honestly? she's iconic. let's get into it π
πΈ NAME πΈ
ww_mutex_unlock β release the w/w mutex, periodt π
β¨ SYNOPSIS β¨
void ww_mutex_unlock (struct ww_mutex *lock );
that's it, that's the whole signature, no cap π«Ά
π¦ ARGUMENTS π¦
lockβ the mutex to be released. that's the one you're letting go of, bestie, like releasing a friendship bracelet back into the wild π
π₯ DESCRIPTION π₯
so here's the tea β: you use this to unlock a mutex that this task already locked before, using any of the ww_mutex_lock* functions β with or without an acquire context, both are valid, we love flexibility π
but listen to me very carefully, bestie, because this is the important part: it is forbidden to release the locks after releasing the acquire context. like, genuinely forbidden. not "eh, it'll probably be fine" forbidden. do not do this π
β οΈ also this function must not be used in interrupt context. and unlocking a mutex that's already unlocked? not allowed. nope. absolutely not. that's giving chaos and we don't want that energy π₯
π SEE ALSO π
- Kernel file
./kernel/locking/mutex.c mutex_lock(9)mutex_unlock(9)ww_mutex_trylock(9)mutex_lock_interruptible(9)mutex_lock_killable(9)mutex_lock_io(9)mutex_trylock(9)atomic_dec_and_mutex_lock(9)
go read those too, iykyk πβ¨
π§ cute little sign-off π§
this page lives in ./kernel/locking, dated October 2026, and it's part of the Kernel API Manual β the ww_mutex_unlock(9) page specifically, in case you forgot already ππ
now go forth and unlock responsibly bestie, ily, don't release locks after the acquire context, 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