summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gem/i915_gem_pages.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-09-10 22:22:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-09-11 08:14:23 +0100
commit99013b10100c4b552eec845ee2ca5604c8332e92 (patch)
tree3bcfdc04fa272d813db40b507efcd4c6496f5971 /drivers/gpu/drm/i915/gem/i915_gem_pages.c
parent85dd14c2918d452fa875a4175bffb76e01c5af6e (diff)
downloadlwn-99013b10100c4b552eec845ee2ca5604c8332e92.tar.gz
lwn-99013b10100c4b552eec845ee2ca5604c8332e92.zip
drm/i915: Make shrink/unshrink be atomic
Add an atomic counter and always take the spinlock around the pin/unpin events, so that we can perform the list manipulation concurrently. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190910212204.17190-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gem/i915_gem_pages.c')
-rw-r--r--drivers/gpu/drm/i915/gem/i915_gem_pages.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
index 18f0ce0135c1..2e941f093a20 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -71,6 +71,7 @@ void __i915_gem_object_set_pages(struct drm_i915_gem_object *obj,
list = &i915->mm.shrink_list;
list_add_tail(&obj->mm.link, list);
+ atomic_set(&obj->mm.shrink_pin, 0);
spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
}
}