]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Only attempt to scan the requested number of shrinker slabs
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Jan 2018 21:24:46 +0000 (21:24 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 1 Feb 2018 15:32:41 +0000 (07:32 -0800)
commitb4e24c1cfd172e47d5ad9ba1b882928da20052f0
tree5c7e68d68e5040ffe6724b0532d56fd63f52202b
parent47594f2b462f05ba7b28155dd1d382af52db036a
drm/i915: Only attempt to scan the requested number of shrinker slabs

Since commit 820db0d1a2fb ("drm/i915: Wire up shrinkctl->nr_scanned"),
we track the number of objects we scan and do not wish to exceed that as
it will overly penalise our own slabs under mempressure. Given that we
now know the target number of objects to scan, use that as our guide for
deciding to shrink as opposed to the number of objects we manage to
shrink (which doesn't correspond to the numbers we report to shrinkctl).

Fixes: 820db0d1a2fb ("drm/i915: Wire up shrinkctl->nr_scanned")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180115212455.24046-2-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 29d384e34c55d696cf37bd4159e05f4b14d45da0)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/i915_gem_shrinker.c