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: [CI 04/26] drm/i915: Remove request retirement before each batch
Date: Thu,  4 Aug 2016 16:32:20 +0100	[thread overview]
Message-ID: <1470324762-2545-4-git-send-email-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <1470324762-2545-1-git-send-email-chris@chris-wilson.co.uk>

This reimplements the denial-of-service protection against igt from
commit 227f782e4667 ("drm/i915: Retire requests before creating a new
one") and transfers the stall from before each batch into get_pages().
The issue is that the stall is increasing latency between batches which
is detrimental in some cases (especially coupled with execlists) to
keeping the GPU well fed. Also we have made the observation that retiring
requests can of itself free objects (and requests) and therefore makes
a good first step when shrinking.

v2: Recycle objects prior to i915_gem_object_get_pages()
v3: Remove the reference to the ring from i915_gem_requests_ring() as it
operates on an intel_engine_cs.
v4: Since commit 9b5f4e5ed6fd ("drm/i915: Retire oldest completed request
before allocating next") we no longer need the safeguard to retire
requests before get_pages(). We no longer see the huge latencies when
hitting the shrinker between allocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h            | 1 -
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 --
 drivers/gpu/drm/i915/i915_gem_request.c    | 4 ++--
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index fbda38f25c6b..2de3d16f7b80 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3169,7 +3169,6 @@ struct drm_i915_gem_request *
 i915_gem_find_active_request(struct intel_engine_cs *engine);
 
 void i915_gem_retire_requests(struct drm_i915_private *dev_priv);
-void i915_gem_retire_requests_ring(struct intel_engine_cs *engine);
 
 static inline u32 i915_reset_counter(struct i915_gpu_error *error)
 {
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 5e3b5054f72d..0593ea3ba211 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -781,8 +781,6 @@ i915_gem_execbuffer_reserve(struct intel_engine_cs *engine,
 	bool has_fenced_gpu_access = INTEL_GEN(engine->i915) < 4;
 	int retry;
 
-	i915_gem_retire_requests_ring(engine);
-
 	vm = list_first_entry(vmas, struct i915_vma, exec_list)->vm;
 
 	INIT_LIST_HEAD(&ordered_vmas);
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 6faa84832ade..773b942a3a5f 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -732,7 +732,7 @@ complete:
 	return ret;
 }
 
-void i915_gem_retire_requests_ring(struct intel_engine_cs *engine)
+static void engine_retire_requests(struct intel_engine_cs *engine)
 {
 	struct drm_i915_gem_request *request, *next;
 
@@ -756,7 +756,7 @@ void i915_gem_retire_requests(struct drm_i915_private *dev_priv)
 	GEM_BUG_ON(!dev_priv->gt.awake);
 
 	for_each_engine(engine, dev_priv) {
-		i915_gem_retire_requests_ring(engine);
+		engine_retire_requests(engine);
 		if (list_empty(&engine->request_list))
 			dev_priv->gt.active_engines &= ~intel_engine_flag(engine);
 	}
-- 
2.8.1

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

  parent reply	other threads:[~2016-08-04 15:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 15:32 [CI 01/26] drm/i915: Combine loops within i915_gem_evict_something Chris Wilson
2016-08-04 15:32 ` [CI 02/26] drm/i915: Remove surplus drm_device parameter to i915_gem_evict_something() Chris Wilson
2016-08-04 15:32 ` [CI 03/26] drm/i915: Double check the active status on the batch pool Chris Wilson
2016-08-04 15:32 ` Chris Wilson [this message]
2016-08-04 15:32 ` [CI 05/26] drm/i915: Remove i915_gem_execbuffer_retire_commands() Chris Wilson
2016-08-04 15:32 ` [CI 06/26] drm/i915: Fix up vma alignment to be u64 Chris Wilson
2016-08-04 15:32 ` [CI 07/26] drm/i915: Pad GTT views of exec objects up to user specified size Chris Wilson
2016-08-04 15:32 ` [CI 08/26] drm/i915: Reduce WARN(i915_gem_valid_gtt_space) to a debug-only check Chris Wilson
2016-08-04 15:32 ` [CI 09/26] drm/i915: Split insertion/binding of an object into the VM Chris Wilson
2016-08-04 15:32 ` [CI 10/26] drm/i915: Convert 4096 alignment request to 0 for drm_mm allocations Chris Wilson
2016-08-04 15:32 ` [CI 11/26] drm/i915: Update the GGTT size/alignment query functions Chris Wilson
2016-08-04 15:32 ` [CI 12/26] drm/i915: Update i915_gem_get_ggtt_size/_alignment to use drm_i915_private Chris Wilson
2016-08-04 15:32 ` [CI 13/26] drm/i915: Record allocated vma size Chris Wilson
2016-08-04 15:32 ` [CI 14/26] drm/i915: Wrap vma->pin_count accessors with small inline helpers Chris Wilson
2016-08-04 15:32 ` [CI 15/26] drm/i915: Start passing around i915_vma from execbuffer Chris Wilson
2016-08-04 15:32 ` [CI 16/26] drm/i915: Combine all i915_vma bitfields into a single set of flags Chris Wilson
2016-08-04 15:32 ` [CI 17/26] drm/i915: Make i915_vma_pin() small and inline Chris Wilson
2016-08-04 15:32 ` [CI 18/26] drm/i915: Remove highly confusing i915_gem_obj_ggtt_pin() Chris Wilson
2016-08-04 15:32 ` [CI 19/26] drm/i915: Separate intel_frontbuffer into its own header Chris Wilson
2016-08-04 15:32 ` [CI 20/26] drm/i915: Make fb_tracking.lock a spinlock Chris Wilson
2016-08-04 15:32 ` [CI 21/26] drm/i915: Use atomics to manipulate obj->frontbuffer_bits Chris Wilson
2016-08-04 15:32 ` [CI 22/26] drm/i915: Use dev_priv consistently through the intel_frontbuffer interface Chris Wilson
2016-08-04 15:32 ` [CI 23/26] drm/i915: Move obj->active:5 to obj->flags Chris Wilson
2016-08-04 15:32 ` [CI 24/26] drm/i915: Move i915_gem_object_wait_rendering() Chris Wilson
2016-08-04 15:32 ` [CI 25/26] drm/i915: Enable lockless lookup of request tracking via RCU Chris Wilson
2016-08-04 15:32 ` [CI 26/26] drm/i915: Export our request as a dma-buf fence on the reservation object Chris Wilson
2016-08-04 16:11 ` ✗ Ro.CI.BAT: failure for series starting with [CI,01/26] drm/i915: Combine loops within i915_gem_evict_something Patchwork
2016-08-04 16:15   ` Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2016-08-04  7:32 [CI 01/26] " Chris Wilson
2016-08-04  7:32 ` [CI 04/26] drm/i915: Remove request retirement before each batch Chris Wilson

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=1470324762-2545-4-git-send-email-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.