STRUCT MSM_VM_OP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct msm_vm_op(9)

okay so bestie, welcome to the Kernel API Manual β€” this one's about struct msm_vm_op, and it's literally just a MAP or UNMAP operation. that's it. that's the whole vibe. πŸ¦‹


✨ NAME ✨

struct msm_vm_op β€” a MAP or UNMAP operation πŸŽ€


🌸 SYNOPSIS 🌸

here's the whole struct, copy it exactly bestie, i'm not joking:

struct msm_vm_op {
    enum {
      MSM_VM_OP_MAP = 1,
      MSM_VM_OP_UNMAP,
    } op;
    union {
      struct msm_vm_map_op map;
      struct msm_vm_unmap_op unmap;
    };
    struct list_head node;
    struct drm_gem_object *obj;
 };

no cap, that's the shape of it. 🫢


πŸ’– Members πŸ’–

okay let's go through the fields one by one, i gotchu:

  • op β€” the operation type. that's the whole assignment. which op are we doing, bestie? πŸ‘‘
  • {unnamed_union} β€” anonymous. yes, it literally has no name. mysterious. iconic. main character energy. πŸ™ˆ
  • map β€” the parameters used if op == MSM_VMA_OP_MAP. πŸ—ΊοΈ
  • unmap β€” the parameters used if op == MSM_VMA_OP_UNMAP. 🧹
  • node β€” the list head in msm_vm_bind_job::vm_ops. it's giving linked-list realness. πŸ”—
  • obj β€” backing object for pages to be mapped/unmapped. the actual backbone, fr fr. πŸ’€

🧚 a lil note on references (important, don't skip)

async unmap ops β€” in particular β€” must hold a reference to the original GEM object backing the mapping that will be unmapped. no exceptions, bestie. ⚠️

but the same can be required in the map path too β€” for example if there's not a corresponding unmap op, like on process exit. yeah. that happens. 😭

this ensures that the pages backing the mapping are not freed before the mapping is torn down. like, the pages stay alive until the teardown is done, periodt. ✨


πŸ”₯ SEE ALSO πŸ”₯

go read those next, i promise they slay too. πŸ“šπŸ’œ


ok that's the whole page bestie, you ate that. now go map some pages (or unmap them, i don't judge). πŸ“

✨ mwah ✨ this lil masterpiece lives in ./drivers/gpu/drm/msm, dated October 2026, and it's struct msm_vm_op(9) in case you forgot already. byeeee πŸ’…πŸŽ€

πŸ“¦ where this page comes from