xe_vm_invalidate_vma_submit(9)
π xe_vm_invalidate_vma_submit(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in the xe driver, you've got a VMA that needs its GPU mappings gone, and you do not wanna sit there blocking on a TLB flush like some kind of loser. that's literally this function. she's from the Kernel API Manual, she's iconic, let's go π
β¨ NAME β¨
xe_vm_invalidate_vma_submit β submit a job that invalidates GPU mappings for a VMA. no cap, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
int xe_vm_invalidate_vma_submit (struct xe_vma *vma , struct
xe_tlb_inval_batch *batch );
likeβ¦ she takes a VMA and a batch, and she hands you back an int. simple. elegant. periodt π
π ARGUMENTS π
vmaβ the VMA you're invalidating. the main character of this whole operation πbatchβ the TLB invalidation batch she populates for you. heads up though: the caller must later callxe_tlb_inval_batch_waiton it to actually wait for completion. she does not do the waiting for you, that's your job bestie π«Ά
π DESCRIPTION π
so here's what she does, step by step, no gatekeeping:
she walks a list of page table leaves β and like, walking a list of page table leaves is such a mood β and she memsets the entries owned by this VMA to zero. zero them. gone. bye. π§
then she invalidates the TLBs, and here's the part that's giving main character energy: she doesn't block waiting for the TLB flush to complete. nope. not her problem right now. instead she populates batch, which you can wait on later using xe_tlb_inval_batch_wait. asynchronous queen behavior fr fr β¨
returns 0 for success, or a negative error code otherwise. so like, check that return value, i'm begging π
π₯ SEE ALSO π₯
the whole friend group, all in the kernel file ./drivers/gpu/drm/xe/xe_vm.c β she does not roll alone:
xe_vm_drm_exec_lock(9)xe_vm_remove_compute_exec_queue(9)xe_vm_kill(9)xe_vm_validate_rebind(9)xe_vm_bump_lru(9)xe_vm_resume_rebind_worker(9)xe_vm_add_fault_entry_pf(9)xe_vm_range_rebind(9)xe_vm_range_unbind(9)xe_vma_mem_attr_copy(9)xe_vm_lock_vma(9)xe_vm_create_scratch(9)xe_vm_find_vma_by_addr(9)xe_vma_has_default_mem_attrs(9)struct xe_vma_lock_and_validate_flags(9)xe_vm_bind_kernel_bo(9)xe_vm_lock(9)xe_vm_unlock(9)xe_vm_invalidate_vma(9)xe_vma_need_vram_for_atomic(9)xe_vm_alloc_madvise_vma(9)xe_vm_find_cpu_addr_mirror_vma_range(9)xe_vm_alloc_cpu_addr_mirror_vma(9)xe_vm_add_exec_queue(9)xe_vm_remove_exec_queue(9)
ngl bestie, if you forget the xe_tlb_inval_batch_wait step, the flush just vibe-checks into the void and nobody waits for it. don't do that. π
k that's the page!! byeeeee π
π this one lives in ./drivers/gpu/drm/xe, stamped October 2026, and she's filed under xe_vm_invalidate_vma_submit(9) β go forth and invalidate responsibly, mwah π
π¦ 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