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 <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161101084843.3961-2-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson 2016-11-01 08:48:42 +00:00
parent 7d5d59e527
commit 415981623f
1 changed files with 1 additions and 0 deletions

View File

@ -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);