STRUCT RSEQ_EVENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct rseq_event

okay so bestie, welcome to the <purple>struct rseq_event</purple> page from the Kernel API Manual β€” this is the little storage blob that keeps track of all the rseq-related event management business. it's giving "tiny struct, huge responsibilities" and honestly? iconic. ✨


πŸ¦‹ NAME

struct rseq_event β€” Storage for rseq related event management πŸ’–


🌸 SYNOPSIS

struct rseq_event {
    union {
      u64 all;
      struct {
        union {
          u32 events;
          struct {
            u8 sched_switch;
            u8 ids_changed;
            u8 user_irq;
          };
        };
        u8 has_rseq;
        u8 __pad;
        union {
          u16 error;
          struct {
            u8 fatal;
            u8 slowpath;
          };
        };
      };
    };
 };

like… look at all those anonymous unions. nested. layered. all on top, little u8s down at the bottom. it's a whole vibe pyramid πŸŽ€


🫢 MEMBERS

okay so here's the tour, member by member, no skips πŸ‘‘

  • {unnamed_union} β€” anonymous 🫧 (yes really, that's the whole description, she's mysterious)
  • all β€” Compound to initialize and clear the data efficiently. this is the "grab the whole thing in one go" field, bestie. efficient queen πŸ’…
  • {unnamed_struct} β€” anonymous 🌸
  • {unnamed_union} β€” anonymous ✨ (we love a recurring bit)
  • events β€” Compound to access events with a single load/store. one load, one store, no mess πŸ”₯
  • {unnamed_struct} β€” anonymous πŸ¦‹
  • sched_switch β€” True if the task was scheduled and needs update on exit to user. so like, "hey you got scheduled, remember to update when you go back to userspace" 😭
  • ids_changed β€” Indicator that IDs need to be updated. the IDs are changing, the IDs are changing πŸ’«
  • user_irq β€” True on interrupt entry from user mode. loud and interrupting, we stan ⚑
  • has_rseq β€” Greater than 0 if the task has a rseq pointer installed. Contains the RSEQ version number. so it's a bool and a version field, she contains multitudes πŸ’œ
  • {unnamed_union} β€” anonymous πŸ“
  • error β€” Compound error code for the slow path to analyze. the slow path is gonna read this and figure out what went wrong πŸ™ˆ
  • {unnamed_struct} β€” anonymous 🧚
  • fatal β€” User space data corrupted or invalid. bad vibes only, this one's serious πŸ’€
  • slowpath β€” Indicator that slow path processing via TIF_NOTIFY_RESUME is required. "notify me when you resume," basically πŸ“¬

🌈 DESCRIPTION

so the actual rules of the house: sched_switch and ids_changed must be adjacent, and the combo must be 16bit aligned β€” all of that so the scheduler can do a single store when both of them get set at the same time. one store. both flags. chefs kiss πŸ‘‘βœ¨

like don't be reordering them, bestie, the whole single-store trick falls apart. respect the layout fr fr.


⭐ SEE ALSO

  • Kernel file ./include/linux/rseq_types.h
  • struct rseq_ids(9)
  • union rseq_slice_state(9)
  • struct rseq_slice(9)
  • struct rseq_data(9)
  • struct sched_mm_cid(9)
  • struct mm_cid_pcpu(9)
  • struct mm_mm_cid(9)

go read them, iykyk πŸ¦‹πŸ’–


and that's the page!! brought to you by ./include/linux, dated October 2026 β€” mwah, ily, go read your structs πŸ’…πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from