fault_in_user_writeable(9)
π fault_in_user_writeable(9) β the Kernel API Manual glow-up
okay so bestie, welcome to fault_in_user_writeable, a lil function living in the Kernel API Manual. she's not famous, she's not flashy, but she is literally the cleanup crew for futex code and we're gonna stan her properly. π«Ά
β¨ NAME β¨
fault_in_user_writeable β fault in a user address and verify RW access. that's it, that's the whole vibe check. π
πΈ SYNOPSIS πΈ
int fault_in_user_writeable (u32 __user *uaddr );
one argument, one int coming back atcha. simple. iconic. periodt. β¨
π ARGUMENTS π
uaddrβ pointer to the faulting user space address. yes bestie, user space, so be on your best behaviour about it. π¦
π₯ DESCRIPTION π₯
so this is the slow path to fixup the fault we just took in the atomic write access to uaddr. think of it as the "okay gorl, let's handle this properly" branch instead of the fast in-line moment. π
here's the thing though β we have no generic implementation of a non-destructive write to the user address. none. doesn't exist. ngl that's just the situation. π
but here's where it gets cute: we know we faulted in the atomic pagefault disabled section, which means we can as well avoid the #PF overhead by calling get_user_pages right away. so we do exactly that. main character energy from start to finish. π
π‘ tiny reminder in her own words: it's the slow path, it's about a write that isn't destructive, andget_user_pagesgets called straight away to dodge that#PFoverhead. that's the whole story, no plot twists.
π SEE ALSO π
the whole futex friend group shows up, because of course they do (iykyk):
- Kernel file
./kernel/futex/core.c __futex_hash(9)futex_setup_timer(9)get_futex_key(9)futex_top_waiter(9)wait_for_owner_exiting(9)__futex_unqueue(9)futex_unqueue(9)futex_exit_recursive(9)
and that's the page, bestie!! π this one's filed under ./kernel/futex and dated October 2026 β screenshot it, memorise it, tell your friends. π
βπ
π¦ 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