[Intel-gfx] [PATCH v2 3/4] drm/i915: Mark all non-vma being inserted into the address spaces

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 18 09:05:31 UTC 2016


On Thu, Nov 17, 2016 at 02:12:19PM +0000, Chris Wilson wrote:
> On Thu, Nov 17, 2016 at 03:31:54PM +0200, Joonas Lahtinen wrote:
> > On to, 2016-11-17 at 12:08 +0000, Chris Wilson wrote:
> > > We need to distinguish between full i915_vma structs and simple
> > > drm_mm_nodes when considering eviction (i.e. we must be careful not to
> > > treat a mere drm_mm_node as a much larger i915_vma causing memory
> > > corruption, if we are lucky). To do this, color these not-a-vma with -1
> > > (UNCOLORED).
> > > 
> > 
> > I might opt for I915_MM_UNCOLORED, just to stay on the safe side as
> > this is in a .h file.
> 
> I've used i915_mm elsewhere as a subclass of struct mm, so a little wary
> of I915_MM. The other users are enum i915_cache_level, but I didn't want
> to imply that this is a cache level and I wanted something that could
> clearly demarque the I-am-not-vma.
> 
> Maybe COLOR_ME_PINNED?

This morning I feel more like
#define COLOR_UNEVICTABLE (-1)
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list