STRUCT FUTEX_SCHED_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct futex_sched_data(9) β€” Kernel API Manual, but make it make sense

okay bestie, so this is struct futex_sched_data(9) β€” a page straight from the kernel API manual, and it's literally all about the futex related per task data. that's it, that's the vibe. it's a little struct that hangs out per-task and holds all the futex bookkeeping, and we're gonna walk through it together like we're studying for the same exam 🫢


✨ NAME ✨

struct futex_sched_data β€” Futex related per task data. no cap, that's the whole name. it's giving "small struct, big responsibilities" πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

struct futex_sched_data {
    struct robust_list_head __user          *robust_list;
  #ifdef CONFIG_COMPAT;
    struct compat_robust_list_head __user   *compat_robust_list;
  #endif;
    struct list_head                        pi_state_list;
    struct futex_pi_state                   *pi_state_cache;
    struct mutex                            exit_mutex;
    unsigned int                            state;
 };

like, look at her. six-ish fields, one conditional, absolutely main character energy ✨


πŸŽ€ Members πŸŽ€

okay so this is the part where we meet the whole squad, one field at a time πŸ’–

  • robust_list β€” the user space registered robust list pointer. yes, "user space registered" β€” that pointer lives in userspace and it's registered, and we're just holding onto it here 🌸
  • compat_robust_list β€” the user space registered robust list pointer, but for compat tasks. same deal, different flavour, iykyk 🧚 (and note it only even exists when CONFIG_COMPAT is on, because it's tucked inside that #ifdef, periodt)
  • pi_state_list β€” the list head for Priority Inheritance (PI) state management. yes, that's the actual expansion of PI, spelled out for us, we love a glossary moment πŸ‘‘
  • pi_state_cache β€” a pointer that caches one PI state object per task. one. per task. lowkey efficient πŸ’…
  • exit_mutex β€” a mutex for serializing exit. it's the bouncer at the door making sure the exits happen one at a time, no chaos 😌
  • state β€” the futex handling state, and its whole job is to handle exit races correctly. very "i'm the one who keeps things from falling apart" of her fr fr πŸ”₯

🌈 SEE ALSO 🌈

go read these next, bestie, they're all in the same kernel file ./include/linux/futex_types.h:

  • struct futex_mm_phash(9)
  • struct futex_unlock_cs_range(9)
  • struct futex_unlock_cs_ranges(9)
  • struct futex_mm_data(9)

like a little futex friend group πŸ¦‹βœ¨


ok that's the whole page, no filler, every field accounted for πŸ’œ now go be obsessed with futexes responsibly.

and that's a wrap, bestie!! this came to you from ./include/linux, dated October 2026, and it's struct futex_sched_data(9) from the Kernel API Manual β€” mwah, slay, study hard πŸŽ€πŸ’–πŸŒΈ

πŸ“¦ where this page comes from