STRUCT MM_MM_CID(9)
πΈ 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β theirq_workthat 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, iykyklockβ 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 mmuser_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 frommm::mm_usersbecause that gets modified bymmget/mm_putfrom 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms