i915_gem_evict_vm(9)
π i915_gem_evict_vm β like, the kernel API manual page for it, bestie β¨
Okay so real talk, this page lives in the Linux Kernel API Manual and the function it's serving is literally called i915_gem_evict_vm. Yes the title's a mouthful, no we're not renaming it π
β¨ NAME β¨
i915_gem_evict_vm β evict all the idle vmas from a vm. That's it, that's the whole job, no cap π§Ή
π SYNOPSIS π
int i915_gem_evict_vm(struct i915_address_space *vm,
struct i915_gem_ww_ctx *ww,
struct drm_i915_gem_object **busy_bo);
Like, look at her. Three args, returns an int, main character energy fr fr π
π¦ ARGUMENTS π¦
vmβ the address space you're cleansing πΈ this is the thing getting scrubbed, okay?wwβ an optionalstruct i915_gem_ww_ctx. If it's notNULL, theni915_gem_evict_vmwill totally be able to evict vma's locked by thewwas well. Teamwork, slay π«Άbusy_boβ optional pointer to astruct drm_i915_gem_object. And okay, this one's important so like, listen up bestie:- if it's not
NULL, then in the eventi915_gem_evict_vmcan't trylock an object for eviction,busy_bowill point to it π― -EBUSYis also returned in that case, bestie, that's the vibe check failing π- the caller must drop the
vm->mutexbefore trying again to acquire the contended lock β οΈ like, do not skip this step, I'm so serious - the caller also owns a reference to the object, so like, congrats, that's yours now π
- if it's not
π DESCRIPTION π
This function evicts all the vmas from a vm. All of them. The whole friend group π§
It's used by the execbuf code as a last-ditch effort to defragment the address space β think of it as the "okay we've tried literally everything else" era of the operation π€
And to clarify, because people stay getting confused: this is for freeing up virtual address space, not for freeing memory in e.g. the shrinker. Different thing entirely, bestie, don't conflate them π
β SEE ALSO β
Kernel file ./drivers/gpu/drm/i915/i915_gem_evict.c β go read her, she's iconic π
Both linked, both relevant, iykyk π
And that's the page!! Shoutout to ./drivers/gpu/drm/i915 for hosting this whole situation, dated October 2026, periodt ππ
π¦ 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