[Intel-gfx] [PATCH 3/6] drm/i915: Move dev_priv->mm.[un]bound_list to its own lock

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Aug 16 13:13:43 UTC 2017


On Sat, 2017-08-12 at 12:51 +0100, Chris Wilson wrote:
> Remove the struct_mutex requirement around dev_priv->mm.bound_list and
> dev_priv->mm.unbound_list by giving it its own spinlock. This reduces
> one more requirement for struct_mutex and in the process gives us
> slightly more accurate unbound_list tracking, which should improve the
> shrinker - but the drawback is that we drop the retirement before
> counting so i915_gem_object_is_active() may be stale and lead us to
> underestimate the number of objects that may be shrunk (see commit
> bed50aea61df ("drm/i915/shrinker: Flush active on objects before
> counting")).
> 
> v2: Crosslink the spinlock to the lists it protects, and btw this
> changes s/obj->global_link/obj->mm.link/
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1536,9 +1536,12 @@ static void i915_gem_object_bump_inactive_ggtt(struct drm_i915_gem_object *obj)
>  		list_move_tail(&vma->vm_link, &vma->vm->inactive_list);
>  	}
>  
> +	GEM_BUG_ON(!i915_gem_object_has_pinned_pages(obj));

Lift this precondition to the beginning of this func, there's no need
for the loop to be in front.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list