STRUCT MON_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct mon_data(9) πŸ’–

okay so bestie, welcome to the kernel API manual β€” this one's about struct mon_data, and it's literally the monitoring details for each event file. that's it, that's the vibe. πŸŽ€


✨ SYNOPSIS ✨

struct mon_data {
    struct list_head        list;
    enum resctrl_res_level  rid;
    struct mon_evt          *evt;
    int domid;
    bool sum;
 };

look at her. five fields. absolute icon behavior. πŸ‘‘


🧚 Members 🧚

  • list β€” she's a member of the global mon_data_kn_priv_list list. yes, the global one. main character energy fr fr. πŸ’…
  • rid β€” the resource id that's associated with the event file. that's her whole thing.
  • evt β€” the event structure associated with the event file. like, the event's event. iconic.
  • domid β€” okay so this one's got ✨range✨:
    • when sum is zero, this is the domain that the event file belongs to.
    • when sum is one, this is the id of the L3 cache that all the domains to be summed share.

yes, same field, two totally different jobs. she's versatile. 🌸

  • sum β€” set for RDT_RESOURCE_L3 when the event must be summed across multiple domains. math girlie moment. πŸ”₯

🌈 Description 🌈

so the kernfs kn->priv field of monitoring event files points to this struct. that's the link-up. πŸ¦‹

⚠️ lowkey important: readers and writers must hold rdtgroup_mutex. no exceptions, no shortcuts, no "it'll be fine." hold the mutex. periodt. πŸ’€

πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./fs/resctrl/internal.h
  • cpumask_any_housekeeping(9)
  • struct mon_evt(9)
  • struct rmid_read(9)
  • enum rdtgrp_mode(9)
  • struct mongroup(9)
  • struct rdtgroup(9)
  • struct rftype(9)
  • struct mbm_state(9)

🫢 and that's the whole page bestie! this one came from ./fs/resctrl, dated October 2026 β€” so yeah, note the source and the date, and go be obsessed with your event files. ngl this struct ate. πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from