diff mbox series

drm/i915/gem: Break up long lists of object reclaim

Message ID 20200221100953.2587176-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915/gem: Break up long lists of object reclaim | expand

Commit Message

Chris Wilson Feb. 21, 2020, 10:09 a.m. UTC
Call cond_resched() between each freed object in case we have a really,
really long list, and we don't want to block normal processes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthew Auld Feb. 21, 2020, 4:20 p.m. UTC | #1
On Fri, 21 Feb 2020 at 10:10, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Call cond_resched() between each freed object in case we have a really,
> really long list, and we don't want to block normal processes.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index 450bd4aab8e9..deef07d299a8 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -225,6 +225,7 @@  static void __i915_gem_free_objects(struct drm_i915_private *i915,
 
 		/* But keep the pointer alive for RCU-protected lookups */
 		call_rcu(&obj->rcu, __i915_gem_free_object_rcu);
+		cond_resched();
 	}
 	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
 }