summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-11-01 08:48:43 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-11-01 09:30:09 +0000
commit535972771d8c99dd53471b54c4dd6a4d22313d84 (patch)
treefdc8524d2e671aeaad0006bb0ffa4266f102ff09
parent415981623f80a08ae36e9757cd4fa25da140b877 (diff)
downloadlwn-535972771d8c99dd53471b54c4dd6a4d22313d84.tar.gz
lwn-535972771d8c99dd53471b54c4dd6a4d22313d84.zip
drm/i915: Move the recently scanned objects to the tail after shrinking
During shrinking, we walk over the list of objects searching for victims. Any that are not removed are put back into the global list. Currently, they are put back in order (at the front) which means they will be first to be scanned again. If we instead move them to the rear of the list, we will scan new potential victims on the next pass and waste less time rescanning unshrinkable objects. Normally the lists are kept in rough order to shrinking (with object least frequently used at the start), by moving just scanned objects to the rear we are acknowledging that they are still in use. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161101084843.3961-3-chris@chris-wilson.co.uk
-rw-r--r--drivers/gpu/drm/i915/i915_gem_shrinker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index 9ace5f9f5317..0993afc0e725 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -234,7 +234,7 @@ i915_gem_shrink(struct drm_i915_private *dev_priv,
mutex_unlock(&obj->mm.lock);
}
}
- list_splice(&still_in_list, phase->list);
+ list_splice_tail(&still_in_list, phase->list);
}
if (flags & I915_SHRINK_BOUND)