__futex_hash(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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

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