From: Chris Wilson Date: Fri, 1 Jul 2016 16:23:10 +0000 (+0100) Subject: drm/i915/shrinker: Flush active on objects before counting X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bed50aea61df4e62395620795079f0e7a3876723;p=openwrt%2Fstaging%2Fblogic.git drm/i915/shrinker: Flush active on objects before counting As we inspect obj->active to decide how many objects we can shrink (we only shrink idle objects), it helps to flush the active lists first in order to have a more accurate count of available objects. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-1-git-send-email-chris@chris-wilson.co.uk --- diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c index 886a8797566d..1bf14544d8ad 100644 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c @@ -265,6 +265,8 @@ i915_gem_shrinker_count(struct shrinker *shrinker, struct shrink_control *sc) if (!i915_gem_shrinker_lock(dev, &unlock)) return 0; + i915_gem_retire_requests(dev_priv); + count = 0; list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list) if (can_release_pages(obj))