All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] drm/i915: Insert cond_resched() into i915_gem_free_objects
Date: Fri,  7 Apr 2017 11:25:52 +0100	[thread overview]
Message-ID: <20170407102552.5781-4-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20170407102552.5781-1-chris@chris-wilson.co.uk>

As we may have very many objects to free, check to see if the task needs
to be rescheduled whilst freeing them.

Suggested-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d81cdd4b0edc..d0a363966487 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4335,6 +4335,8 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
 	intel_runtime_pm_put(i915);
 	mutex_unlock(&i915->drm.struct_mutex);
 
+	cond_resched();
+
 	llist_for_each_entry_safe(obj, on, freed, freed) {
 		GEM_BUG_ON(obj->bind_count);
 		GEM_BUG_ON(atomic_read(&obj->frontbuffer_bits));
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-04-07 10:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 10:25 [PATCH 1/4] drm/i915: The shrinker already acquires struct_mutex, so call it unlocked Chris Wilson
2017-04-07 10:25 ` [PATCH 2/4] drm/i915: Drain any freed objects prior to hibernation Chris Wilson
2017-04-07 11:22   ` Joonas Lahtinen
2017-04-07 11:28     ` Chris Wilson
2017-04-07 10:25 ` [PATCH 3/4] drm/i915: Break up long runs of freeing objects Chris Wilson
2017-04-07 11:22   ` Joonas Lahtinen
2017-04-07 10:25 ` Chris Wilson [this message]
2017-04-07 11:23   ` [PATCH 4/4] drm/i915: Insert cond_resched() into i915_gem_free_objects Joonas Lahtinen
2017-04-07 12:40     ` Chris Wilson
2017-04-07 10:44 ` ✓ Fi.CI.BAT: success for series starting with [1/4] drm/i915: The shrinker already acquires struct_mutex, so call it unlocked Patchwork
2017-04-07 11:21 ` [PATCH 1/4] " Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170407102552.5781-4-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.