STRUCT MSM_VM_BIND_JOB(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct msm_vm_bind_job β€” tracking for a VM_BIND ioctl πŸ’…

okay so this page lives in the Kernel API Manual, and the star of the show is struct msm_vm_bind_job(9) β€” the little bookkeeping baddie that keeps track of one single VM_BIND ioctl. it's giving "group project manager" energy and honestly? it ate. πŸ¦‹


✨ SYNOPSIS ✨

struct msm_vm_bind_job {
    struct drm_sched_job base;
    struct drm_gpuvm *vm;
    struct dma_fence *fence;
    struct msm_gpu_submitqueue *queue;
    struct msm_mmu_prealloc prealloc;
    struct list_head vm_ops;
    bool bos_pinned;
    unsigned int nr_ops;
    struct msm_vm_bind_op {
      uint32_t op;
      uint32_t flags;
      union {
        struct drm_gem_object *obj;
        uint32_t handle;
      };
      uint64_t obj_offset;
      uint64_t iova;
      uint64_t range;
    } ops[];
 };

like, look at that trailing ops[] β€” flexible array member main character energy, no notes. πŸ‘‘


🌸 MEMBERS 🌸

  • base β€” the base class for drm_sched jobs. every job needs a foundation, and this is hers. πŸ’–
  • vm β€” the VM being operated on. the actual vibe being transformed, iykyk.
  • fence β€” the fence that is signaled when the job completes. think of it as the "we're so back" notification. πŸ””
  • queue β€” the queue that the job runs on. her designated lane, literally.
  • prealloc β€” tracking for pre-allocated MMU pgtable pages. pre-allocated = pre-planned, and we love a planner. πŸ“‹
  • vm_ops β€” a list of struct msm_vm_op. her little entourage of operations.
  • bos_pinned β€” are the GEM objects being bound pinned? a whole yes/no moment, very vibe check. βœ…
  • nr_ops β€” the number of userspace requested ops. girl is counting, always counting. πŸ”’
  • ops β€” the userspace requested ops. the whole reason she exists, fr fr.

the userspace requested ops are copied/parsed and validated before we start applying the updates, to try to do as much up-front error checking as possible β€” that way the VM doesn't end up in an undefined state due to a partially executed VM_BIND. ⚠️ no cap, that's the entire point: fail early, fail clean, don't leave the VM in shambles mid-operation. πŸ’€

this table also serves to hold a reference to the backing GEM objects. so she's not just a list, she's a lifeline β€” she keeps those objects alive. 🫢

  • {unnamed_union} β€” anonymous. mysterious. doesn't gatekeep her identity. πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so here's the whole storyline, bestie: a table of userspace requested VM updates β€” that's MSM_VM_BIND_OP_UNMAP/MAP/MAP_NULL β€” gets applied to the vm, and that generates a list of VM ops (MSM_VM_OP_MAP/UNMAP) which get applied to the pgtables asynchronously. ✨ async queen ✨

and lowkey the glow-up is real, because one userspace request can multiply. for example, a userspace requested MSM_VM_BIND_OP_MAP could end up generating both an MSM_VM_OP_UNMAP to unmap an existing mapping and an MSM_VM_OP_MAP to apply the new mapping. one request in, two ops out β€” that's range, that's versatility, that's the whole pipeline. πŸ”₯

ngl this is the part where you just trust the flow: userspace asks, the kernel validates, the pgtables get updated async later. simple as.

🌈 SEE ALSO 🌈


and that's the page, bestie β€” brought to you by ./drivers/gpu/drm/msm, dated October 2026, filed under struct msm_vm_bind_job(9). go read the SEE ALSOs, they're literally all connected πŸ§šβ­πŸ’œ

πŸ“¦ where this page comes from