All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915/pmu: Reconstruct active state on starting busy-stats
@ 2018-01-10 16:11 Chris Wilson
  2018-01-10 16:17 ` Tvrtko Ursulin
  2018-01-10 16:46 ` ✓ Fi.CI.BAT: success for " Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2018-01-10 16:11 UTC (permalink / raw)
  To: intel-gfx

We have a hole in our busy-stat accounting if the pmu is enabled during
a long running batch, the pmu will not start accumulating busy-time
until the next context switch. This then fails tests that are only
sampling a single batch.

v2: Count each active port just once (context in/out events are only on
the first and last assigment to a port).

Testcase: igt/perf_pmu/busy-start
Testcase: igt/perf_pmu/busy-double-start
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_engine_cs.c  | 10 +++++++++-
 drivers/gpu/drm/i915/intel_ringbuffer.h |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 6bb51a502b8b..3a11602e60c7 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1951,8 +1951,16 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine)
 	spin_lock_irqsave(&engine->stats.lock, flags);
 	if (engine->stats.enabled == ~0)
 		goto busy;
-	if (engine->stats.enabled++ == 0)
+	if (engine->stats.enabled++ == 0) {
 		engine->stats.enabled_at = ktime_get();
+
+		/* XXX submission method oblivious? */
+		engine->stats.active =
+			port_isset(&engine->execlists.port[1]) +
+			port_isset(&engine->execlists.port[0]);
+		if (engine->stats.active)
+			engine->stats.start = engine->stats.enabled_at;
+	}
 	spin_unlock_irqrestore(&engine->stats.lock, flags);
 
 	return 0;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index c5ff203e42d6..37cf665692e5 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -225,7 +225,7 @@ struct intel_engine_execlists {
 #define port_pack(rq, count) ptr_pack_bits(rq, count, EXECLIST_COUNT_BITS)
 #define port_unpack(p, count) ptr_unpack_bits((p)->request_count, count, EXECLIST_COUNT_BITS)
 #define port_set(p, packed) ((p)->request_count = (packed))
-#define port_isset(p) ((p)->request_count)
+#define port_isset(p) (((p)->request_count) != NULL)
 #define port_index(p, execlists) ((p) - (execlists)->port)
 
 		/**
-- 
2.15.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/i915/pmu: Reconstruct active state on starting busy-stats
  2018-01-10 16:11 [PATCH v2] drm/i915/pmu: Reconstruct active state on starting busy-stats Chris Wilson
@ 2018-01-10 16:17 ` Tvrtko Ursulin
  2018-01-10 16:27   ` Chris Wilson
  2018-01-10 16:46 ` ✓ Fi.CI.BAT: success for " Patchwork
  1 sibling, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2018-01-10 16:17 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 10/01/2018 16:11, Chris Wilson wrote:
> We have a hole in our busy-stat accounting if the pmu is enabled during
> a long running batch, the pmu will not start accumulating busy-time
> until the next context switch. This then fails tests that are only
> sampling a single batch.
> 
> v2: Count each active port just once (context in/out events are only on
> the first and last assigment to a port).
> 
> Testcase: igt/perf_pmu/busy-start
> Testcase: igt/perf_pmu/busy-double-start
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_engine_cs.c  | 10 +++++++++-
>   drivers/gpu/drm/i915/intel_ringbuffer.h |  2 +-
>   2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 6bb51a502b8b..3a11602e60c7 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1951,8 +1951,16 @@ int intel_enable_engine_stats(struct intel_engine_cs *engine)
>   	spin_lock_irqsave(&engine->stats.lock, flags);
>   	if (engine->stats.enabled == ~0)
>   		goto busy;
> -	if (engine->stats.enabled++ == 0)
> +	if (engine->stats.enabled++ == 0) {
>   		engine->stats.enabled_at = ktime_get();
> +
> +		/* XXX submission method oblivious? */
> +		engine->stats.active =
> +			port_isset(&engine->execlists.port[1]) +
> +			port_isset(&engine->execlists.port[0]);
> +		if (engine->stats.active)
> +			engine->stats.start = engine->stats.enabled_at;
> +	}
>   	spin_unlock_irqrestore(&engine->stats.lock, flags);
>   
>   	return 0;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index c5ff203e42d6..37cf665692e5 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -225,7 +225,7 @@ struct intel_engine_execlists {
>   #define port_pack(rq, count) ptr_pack_bits(rq, count, EXECLIST_COUNT_BITS)
>   #define port_unpack(p, count) ptr_unpack_bits((p)->request_count, count, EXECLIST_COUNT_BITS)
>   #define port_set(p, packed) ((p)->request_count = (packed))
> -#define port_isset(p) ((p)->request_count)
> +#define port_isset(p) (((p)->request_count) != NULL)
>   #define port_index(p, execlists) ((p) - (execlists)->port)
>   
>   		/**
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/i915/pmu: Reconstruct active state on starting busy-stats
  2018-01-10 16:17 ` Tvrtko Ursulin
@ 2018-01-10 16:27   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2018-01-10 16:27 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-01-10 16:17:50)
> 
> On 10/01/2018 16:11, Chris Wilson wrote:
> > We have a hole in our busy-stat accounting if the pmu is enabled during
> > a long running batch, the pmu will not start accumulating busy-time
> > until the next context switch. This then fails tests that are only
> > sampling a single batch.
> > 
> > v2: Count each active port just once (context in/out events are only on
> > the first and last assigment to a port).
> > 
> > Testcase: igt/perf_pmu/busy-start
> > Testcase: igt/perf_pmu/busy-double-start
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

And Tvrkto also pointed out,
Fixes: 30e17b7847f5 ("drm/i915: Engine busy time tracking")

Though we are unlikely to be affected outside of the confines of igt
testing single batches and expecting perfection.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/pmu: Reconstruct active state on starting busy-stats
  2018-01-10 16:11 [PATCH v2] drm/i915/pmu: Reconstruct active state on starting busy-stats Chris Wilson
  2018-01-10 16:17 ` Tvrtko Ursulin
@ 2018-01-10 16:46 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-01-10 16:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/pmu: Reconstruct active state on starting busy-stats
URL   : https://patchwork.freedesktop.org/series/36283/
State : success

== Summary ==

Series 36283v1 drm/i915/pmu: Reconstruct active state on starting busy-stats
https://patchwork.freedesktop.org/api/1.0/series/36283/revisions/1/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-fail -> FAIL       (fi-elk-e7500) fdo#103989 +2
Test gem_exec_fence:
        Subgroup await-hang-default:
                dmesg-fail -> PASS       (fi-pnv-d510) fdo#104572
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                pass       -> DMESG-WARN (fi-kbl-r) fdo#104172 +1
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#104572 https://bugs.freedesktop.org/show_bug.cgi?id=104572
fdo#104172 https://bugs.freedesktop.org/show_bug.cgi?id=104172
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:422s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:371s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:492s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:279s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:467s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:458s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:0   fail:1   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:275s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:518s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:393s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:460s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:419s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:463s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:499s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:502s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:578s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:425s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:534s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:494s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:492s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:401s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:567s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:470s
fi-bdw-gvtdvm failed to collect. IGT log at Patchwork_7645/fi-bdw-gvtdvm/igt.log

4269b88bf52fc7a991d05ca75d1b5f86052b8eab drm-tip: 2018y-01m-10d-14h-03m-47s UTC integration manifest
cec98c4b1def drm/i915/pmu: Reconstruct active state on starting busy-stats

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7645/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-10 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 16:11 [PATCH v2] drm/i915/pmu: Reconstruct active state on starting busy-stats Chris Wilson
2018-01-10 16:17 ` Tvrtko Ursulin
2018-01-10 16:27   ` Chris Wilson
2018-01-10 16:46 ` ✓ Fi.CI.BAT: success for " Patchwork

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.