__futex_hash(9)
π __futex_hash β Kernel API Manual, but make it a group chat π«Ά
okay so bestie, welcome to the <pink>Kernel API Manual</pink> β¨ this page is about __futex_hash(9) and honestly it's giving "small function, big feelings" energy. Let's get into it π
πΈ NAME πΈ
__futex_hash β return the hash bucket πͺ£β¨
like, that's it. that's the whole vibe. it hands you back a hash bucket, no cap.
π¦ SYNOPSIS π¦
struct futex_hash_bucket * __futex_hash (union futex_key *key , struct
futex_private_hash *fph , struct futex_private_hash **fph_p );
so you call it like that β¬οΈ and it gives you back a struct futex_hash_bucket *. periodt π
π ARGUMENTS π
keyβ pointer to the futex key where the hash gets calculated π like, this is the whole reason we're here, she's the main character.fphβ pointer to the private hash if you already know it π so if you've got it, pass it in, you're so prepared bestie.fph_pβ pointer to a private hash pointer, and it's also an output for the private hash used when it's set π€ so like, it goes in, and info comes back out. multi-tasking icon.
π₯ DESCRIPTION π₯
so the way that this works π we hash on the keys returned from get_futex_key (see below, bestie, it's right there) and we return the corresponding hash bucket. simple. elegant. slay.
and here's the lil conditional moment you need to know about π«
if the FUTEX is PROCESS_PRIVATE, then a per-process hash bucket (from the private hash) is returned if existing. iykyk.
otherwise? a hash bucket from the global hash is returned π that's the fallback, and she ate.
ngl this is exactly the kind of branch you wanna pay attention to β private hash first, global hash as the otherwise. don't mix 'em up π
β SEE ALSO β
go read these too, they're all lowkey important π§ and they live in this kernel file: ./kernel/futex/core.c
futex_setup_timer(9)get_futex_key(9)fault_in_user_writeable(9)futex_top_waiter(9)wait_for_owner_exiting(9)__futex_unqueue(9)futex_unqueue(9)futex_exit_recursive(9)
fr fr, the whole futex friend group is iconic π
and that's the page!! source/version: ./kernel/futex, dated October 2026 πΈ mwah, go forth and hash responsibly bestie π
ππ¦
π¦ 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