From: Chris Wilson Date: Wed, 20 Apr 2016 11:09:50 +0000 (+0100) Subject: drm/i915/shrinker: Only report objects with extra pinned pages as pinned X-Git-Tag: MMI-PSA29.97-13-9~7427^2~45^2~217 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca61d4a425f2e23e870e027f2450fb126a1f2103;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/i915/shrinker: Only report objects with extra pinned pages as pinned When iterating over the bound list, we expect all objects there to have their pages pinned (by the bound VMA). So only report those objects with additional pin count on their pages as "pinned". These should be those objects used for display and hardware access. Reported-by: Akash Goel Signed-off-by: Chris Wilson Cc: Akash Goel Cc: Joonas Lahtinen Reviewed-by: Joonas Lahtinen Link: http://patchwork.freedesktop.org/patch/msgid/1461150592-27818-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 d46388f25e04..4e4fcfa76b4c 100644 --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c @@ -361,7 +361,7 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr) if (!obj->base.filp) continue; - if (obj->pages_pin_count) + if (obj->pages_pin_count > num_vma_bound(obj)) pinned += obj->base.size; else bound += obj->base.size;