From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/7] drm/i915: Keep a count of requests submitted from userspace
Date: Wed, 6 Jun 2018 13:48:44 +0100 [thread overview]
Message-ID: <20180606124848.13050-4-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20180606124848.13050-1-tvrtko.ursulin@linux.intel.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Keep a count of requests submitted from userspace and not yet runnable due
unresolved dependencies.
v2: Rename and move under the container struct. (Chris Wilson)
v3: Rebase.
v4: Move decrement site to the backend to shrink the window of double-
accounting as much as possible. (Chris Wilson)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/i915_request.c | 3 +++
drivers/gpu/drm/i915/intel_engine_cs.c | 3 ++-
drivers/gpu/drm/i915/intel_lrc.c | 2 ++
drivers/gpu/drm/i915/intel_ringbuffer.h | 8 ++++++++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index b8ddcd23a6f3..53ba70ea7af3 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -558,6 +558,7 @@ void i915_request_submit(struct i915_request *request)
spin_lock_irqsave(&engine->timeline.lock, flags);
engine->request_stats.runnable++;
+ atomic_dec(&engine->request_stats.queued);
__i915_request_submit(request);
@@ -1109,6 +1110,8 @@ void __i915_request_add(struct i915_request *request, bool flush_caches)
}
request->emitted_jiffies = jiffies;
+ atomic_inc(&engine->request_stats.queued);
+
/*
* Let the backend know a new request has arrived that may need
* to adjust the existing execution schedule due to a high priority
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 1bb3be96ca08..d2a51aefed38 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1420,11 +1420,12 @@ void intel_engine_dump(struct intel_engine_cs *engine,
if (i915_terminally_wedged(&engine->i915->gpu_error))
drm_printf(m, "*** WEDGED ***\n");
- drm_printf(m, "\tcurrent seqno %x, last %x, hangcheck %x [%d ms], runnable %u\n",
+ drm_printf(m, "\tcurrent seqno %x, last %x, hangcheck %x [%d ms], queued %u, runnable %u\n",
intel_engine_get_seqno(engine),
intel_engine_last_submit(engine),
engine->hangcheck.seqno,
jiffies_to_msecs(jiffies - engine->hangcheck.action_timestamp),
+ atomic_read(&engine->request_stats.queued),
engine->request_stats.runnable);
drm_printf(m, "\tReset count: %d (global %d)\n",
i915_reset_engine_count(error, engine),
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index ed90f7a46e9a..cac9888376b0 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1201,7 +1201,9 @@ static void execlists_submit_request(struct i915_request *request)
queue_request(engine, &request->sched, rq_prio(request));
submit_queue(engine, rq_prio(request));
+
engine->request_stats.runnable++;
+ atomic_dec(&engine->request_stats.queued);
GEM_BUG_ON(!engine->execlists.first);
GEM_BUG_ON(list_empty(&request->sched.link));
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 3e0cfac49755..eeb7f3662195 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -345,6 +345,14 @@ struct intel_engine_cs {
void *pinned_default_state;
struct {
+ /**
+ * @queued: Number of submitted requests with dependencies.
+ *
+ * Count of requests waiting for dependencies before they can be
+ * submitted to the backend.
+ */
+ atomic_t queued;
+
/**
* @runnable: Number of runnable requests sent to the backend.
*
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-06-06 12:48 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 12:48 [PATCH v6 0/7] Queued/runnable/running engine stats Tvrtko Ursulin
2018-06-06 12:48 ` [PATCH 1/7] drm/i915/pmu: Fix enable count array size and bounds checking Tvrtko Ursulin
2018-06-06 12:48 ` [PATCH 2/7] drm/i915: Keep a count of requests waiting for a slot on GPU Tvrtko Ursulin
2018-06-06 12:48 ` Tvrtko Ursulin [this message]
2018-06-06 12:48 ` [PATCH 4/7] drm/i915/pmu: Add queued counter Tvrtko Ursulin
2018-06-06 13:16 ` Chris Wilson
2018-06-06 13:24 ` Tvrtko Ursulin
2018-06-06 14:39 ` Tvrtko Ursulin
2018-06-07 13:24 ` Tvrtko Ursulin
2018-06-06 12:48 ` [PATCH 5/7] drm/i915/pmu: Add runnable counter Tvrtko Ursulin
2018-06-06 14:39 ` Tvrtko Ursulin
2018-06-07 13:24 ` Tvrtko Ursulin
2018-06-06 12:48 ` [PATCH 6/7] drm/i915/pmu: Add running counter Tvrtko Ursulin
2018-06-06 14:40 ` Tvrtko Ursulin
2018-06-06 15:23 ` Chris Wilson
2018-06-06 15:52 ` Tvrtko Ursulin
2018-06-07 13:25 ` Tvrtko Ursulin
2018-06-07 14:45 ` Chris Wilson
2018-06-06 12:48 ` [PATCH 7/7] drm/i915: Engine queues query Tvrtko Ursulin
2018-06-06 13:31 ` ✓ Fi.CI.BAT: success for Queued/runnable/running engine stats (rev8) Patchwork
2018-06-06 15:17 ` ✓ Fi.CI.BAT: success for Queued/runnable/running engine stats (rev11) Patchwork
2018-06-06 16:06 ` ✗ Fi.CI.IGT: failure for Queued/runnable/running engine stats (rev8) Patchwork
2018-06-06 17:26 ` ✓ Fi.CI.IGT: success for Queued/runnable/running engine stats (rev11) Patchwork
2018-06-07 13:57 ` ✓ Fi.CI.BAT: success for Queued/runnable/running engine stats (rev14) Patchwork
2018-06-07 17:55 ` ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-04-05 12:39 [PATCH v5 0/7] Queued/runnable/running engine stats Tvrtko Ursulin
2018-04-05 12:39 ` [PATCH 3/7] drm/i915: Keep a count of requests submitted from userspace Tvrtko Ursulin
2018-04-06 20:17 ` Chris Wilson
2018-04-09 9:11 ` Tvrtko Ursulin
2018-04-09 9:25 ` Chris Wilson
2018-04-09 10:17 ` Tvrtko Ursulin
2018-04-09 10:27 ` Chris Wilson
2018-04-09 10:29 ` Chris Wilson
2018-04-09 10:40 ` Tvrtko Ursulin
2018-04-09 10:51 ` Chris Wilson
2018-04-09 11:43 ` Tvrtko Ursulin
2018-04-09 11:54 ` Chris Wilson
2018-03-19 18:16 [PATCH v4 0/7] Queued/runnable/running engine stats Tvrtko Ursulin
2018-03-19 18:16 ` [PATCH 3/7] drm/i915: Keep a count of requests submitted from userspace Tvrtko Ursulin
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=20180606124848.13050-4-tvrtko.ursulin@linux.intel.com \
--to=tursulin@ursulin.net \
--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.