STRUCT MM_MM_CID(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct mm_mm_cid(9) 🌸

okay bestie, so this is straight out of the Kernel API Manual, section 9, and it's literally the storage situation for per-MM CID data πŸ’… like this struct is where all the CID bookkeeping for a whole mm lives, and you're gonna want to know every single field because they all matter, no cap.


✨ NAME ✨

struct mm_mm_cid β€” storage for per MM CID data πŸŽ€


✨ SYNOPSIS ✨

struct mm_mm_cid {
    struct mm_cid_pcpu      __percpu *pcpu;
    unsigned int            mode;
    unsigned int            max_cids;
    struct irq_work         irq_work;
    struct work_struct      work;
    raw_spinlock_t lock;
    struct mutex            mutex;
    struct hlist_head       user_list;
    unsigned int            nr_cpus_allowed;
    unsigned int            users;
    unsigned int            pcpu_thrs;
    unsigned int            update_deferred;
 };

πŸ’– Members πŸ’–

  • pcpu β€” the per-CPU storage for the CIDs that are associated to a CPU, iconic, we love per-CPU everything πŸ¦‹
  • mode β€” tells you which mode we're in: it indicates per CPU mode and transition mode ✨
  • max_cids β€” the exclusive maximum CID value, used for allocation and for convergence (yes, exclusive, note that πŸ’€)
  • irq_work β€” the irq_work that handles the affinity mode change case πŸ”₯
  • work β€” regular work that also handles the affinity mode change case, because sometimes you can't do it in irq context, iykyk
  • lock β€” a spinlock protecting against affinity setting, which literally can't take a mutex πŸ™ˆ
  • mutex β€” a mutex to serialize forks and exits that are related to this mm
  • user_list β€” the list of the MM CID users of a MM 🫢
  • nr_cpus_allowed β€” the number of CPUs in the per-MM allowed CPUs map. heads up: the map is growth only πŸ“ˆ
  • users β€” the number of tasks sharing this MM. this one is separate from mm::mm_users because that gets modified by mmget/mm_put from other entities that don't actually share the MM, so don't go confusing them bestie 😭
  • pcpu_thrs β€” the threshold for switching back from per CPU mode ⭐
  • update_deferred β€” a deferred switch back to per task mode is pending ⏳

🌈 SEE ALSO 🌈

Kernel file ./include/linux/rseq_types.h β€” plus struct rseq_event(9), struct rseq_ids(9), union rseq_slice_state(9), struct rseq_slice(9), struct rseq_data(9), struct sched_mm_cid(9), and struct mm_cid_pcpu(9) β€” go read them all, they're all connected fr fr 🧚


that's the whole vibe check, bestie β€” sourced from ./include/linux, dated October 2026, and officially titled struct mm_mm_cid(9). slay, you now know your CIDs πŸ’œπŸ‘‘

πŸ“¦ where this page comes from