STRUCT KSM_RMAP_ITEM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 next rmap_item in mm_slot's singly-linked rmap_list. linked-list bestie behavior, fr fr. πŸ”—
  • {unnamed_union} β€” anonymous. no name, just mystery. πŸ™ˆ
    • anon_vma β€” pointer to anon_vma for this mm,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 this rmap_item is pointing into. 🧠
  • address β€” the virtual address this rmap_item tracks (+ 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 this rmap_item in the unstable tree. 🌳
    • {unnamed_struct} β€” anonymous.
      • head β€” pointer to stable_node heading this list in the stable tree. πŸ‘‘
      • hlist β€” link into hlist of rmap_items hanging off that stable_node. πŸͺ

πŸ” SEE ALSO πŸ”


Source/version vibes: ./mm Β· date: October 2026 Β· manual: struct ksm_rmap_item(9). that's the footer, bestie β€” bye! πŸ’–πŸŽ€

πŸ“¦ where this page comes from