STRUCT KSM_RMAP_ITEM(9)
π NAME π
okay bestie, welcome to struct ksm_rmap_item(9) from the Kernel API Manual β this one is literally the reverse mapping item for virtual addresses. yep, that's the whole vibe. π«Ά
β¨ SYNOPSIS β¨
no cap, here's the exact shape of it:
struct ksm_rmap_item {
struct ksm_rmap_item *rmap_list;
union {
struct anon_vma *anon_vma;
#ifdef CONFIG_NUMA;
int nid;
#endif;
};
struct mm_struct *mm;
unsigned long address;
union {
struct {
unsigned int oldchecksum;
rmap_age_t age;
rmap_age_t remaining_skips;
};
unsigned long linear_page_index;
};
union {
struct rb_node node;
struct {
struct ksm_stable_node *head;
struct hlist_node hlist;
};
};
};
π«Ά Members π«Ά
rmap_listβ the nextrmap_iteminmm_slot's singly-linkedrmap_list. linked-list bestie behavior, fr fr. π{unnamed_union}β anonymous. no name, just mystery. πanon_vmaβ pointer toanon_vmafor thismm,address, when in stable tree. πnidβ NUMA node id of unstable tree in which linked (may not match page). noted, bestie.
mmβ the memory structure thisrmap_itemis pointing into. π§addressβ the virtual address thisrmap_itemtracks (+ flags in low bits). yes, the low bits are doing their own little thing. β¨{unnamed_union}β anonymous. again. iconic. π{unnamed_struct}β anonymous.oldchecksumβ previous checksum of the page at that virtual address. π§Ύageβ number of scan iterations since creation (unstable node). β³remaining_skipsβ how many scans to skip (unstable node). okay skip queen. π
linear_page_indexβ the original page's index before merged by KSM (stable node). π
{unnamed_union}β anonymous. one more for the road. πnodeβ rb node of thisrmap_itemin the unstable tree. π³{unnamed_struct}β anonymous.headβ pointer tostable_nodeheading this list in the stable tree. πhlistβ link into hlist ofrmap_itemshanging off thatstable_node. πͺ
π SEE ALSO π
- Kernel file
./mm/ksm.cOverview(9) struct ksm_mm_slot(9)struct ksm_scan(9)struct ksm_stable_node(9)struct advisor_ctx(9)replace_page(9)ksm_do_scan(9)ksm_vma_flags(9)ksm_enable_merge_any(9)ksm_disable_merge_any(9)
Source/version vibes: ./mm Β· date: October 2026 Β· manual: struct ksm_rmap_item(9). that's the footer, bestie β bye! ππ
π¦ 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