From 415981623f80a08ae36e9757cd4fa25da140b877 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 1 Nov 2016 08:48:42 +0000 Subject: [PATCH] drm/i915: Discard objects from mm global_list after being shrunk In the shrinker, we can safely remove an empty object (obj->mm.pages == NULL) after having discarded the pages because we are holding the struct_mutex. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: http://patchwork.freedesktop.org/patch/msgid/20161101084843.3961-2-chris@chris-wilson.co.uk --- drivers/gpu/drm/i915/i915_gem_shrinker.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c index 0daa09cabbcc..9ace5f9f5317 100644 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c @@ -228,6 +228,7 @@ i915_gem_shrink(struct drm_i915_private *dev_priv, SINGLE_DEPTH_NESTING); if (!obj->mm.pages) { __i915_gem_object_invalidate(obj); + list_del_init(&obj->global_list); count += obj->base.size >> PAGE_SHIFT; } mutex_unlock(&obj->mm.lock); -- 2.20.1