dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Martin Peres <martin.peres@linux.intel.com>
To: Robert Bragg <robert@sixbynine.org>, Martin Peres <martin.peres@free.fr>
Cc: Deepak S <deepak.s@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Sourab Gupta <sourab.gupta@intel.com>,
	ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit
Date: Wed, 4 May 2016 12:09:50 +0300	[thread overview]
Message-ID: <03bed47b-28aa-e65e-3658-df0e9046eeee@linux.intel.com> (raw)
In-Reply-To: <CAMou1-2SJWcvdUuHRvSMG38VxdtdAcxWv=0zQ05v_TA9SWPx-Q@mail.gmail.com>

On 03/05/16 23:03, Robert Bragg wrote:
>
>
> On Tue, May 3, 2016 at 8:34 PM, Robert Bragg <robert@sixbynine.org
> <mailto:robert@sixbynine.org>> wrote:
>
>     Sorry for the delay replying to this, I missed it.
>
>     On Sat, Apr 23, 2016 at 11:34 AM, Martin Peres <martin.peres@free.fr
>     <mailto:martin.peres@free.fr>> wrote:
>
>         On 20/04/16 17:23, Robert Bragg wrote:
>
>             Gen graphics hardware can be set up to periodically write
>             snapshots of
>             performance counters into a circular buffer via its Observation
>             Architecture and this patch exposes that capability to
>             userspace via the
>             i915 perf interface.
>
>             Cc: Chris Wilson <chris@chris-wilson.co.uk
>             <mailto:chris@chris-wilson.co.uk>>
>             Signed-off-by: Robert Bragg <robert@sixbynine.org
>             <mailto:robert@sixbynine.org>>
>             Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com
>             <mailto:zhenyuw@linux.intel.com>>
>             ---
>               drivers/gpu/drm/i915/i915_drv.h         |  56 +-
>               drivers/gpu/drm/i915/i915_gem_context.c |  24 +-
>               drivers/gpu/drm/i915/i915_perf.c        | 940
>             +++++++++++++++++++++++++++++++-
>               drivers/gpu/drm/i915/i915_reg.h         | 338 ++++++++++++
>               include/uapi/drm/i915_drm.h             |  70 ++-
>               5 files changed, 1408 insertions(+), 20 deletions(-)
>
>             +
>             +
>             +       /* It takes a fairly long time for a new MUX
>             configuration to
>             +        * be be applied after these register writes. This delay
>             +        * duration was derived empirically based on the
>             render_basic
>             +        * config but hopefully it covers the maximum
>             configuration
>             +        * latency...
>             +        */
>             +       mdelay(100);
>
>
>         With such a HW and SW design, how can we ever expose hope to get any
>         kind of performance when we are trying to monitor different
>         metrics on each
>         draw call? This may be acceptable for system monitoring, but it
>         is problematic
>         for the GL extensions :s
>
>
>         Since it seems like we are going for a perf API, it means that
>         for every change
>         of metrics, we need to flush the commands, wait for the GPU to
>         be done, then
>         program the new set of metrics via an IOCTL, wait 100 ms, and
>         then we may
>         resume rendering ... until the next change. We are talking about
>         a latency of
>         6-7 frames at 60 Hz here... this is non-negligeable...
>
>
>         I understand that we have a ton of counters and we may hide
>         latency by not
>         allowing using more than half of the counters for every draw
>         call or frame, but
>         even then, this 100ms delay is killing this approach altogether.
>
>
>
>
> So revisiting this to double check how things fail with my latest
> driver/tests without the delay, I apparently can't reproduce test
> failures without the delay any more...
>
> I think the explanation is that since first adding the delay to the
> driver I also made the the driver a bit more careful to not forward
> spurious reports that look invalid due to a zeroed report id field, and
> that mechanism keeps the unit tests happy, even though there are still
> some number of invalid reports generated if we don't wait.
>
> One problem with simply having no delay is that the driver prints an
> error if it sees an invalid reports so I get a lot of 'Skipping
> spurious, invalid OA report' dmesg spam. Also this was intended more as
> a last resort mechanism, and I wouldn't feel too happy about squashing
> the error message and potentially sweeping other error cases under the
> carpet.
>
> Experimenting to see if the delay can at least be reduced, I brought the
> delay up in millisecond increments and found that although I still see a
> lot of spurious reports only waiting 1 or 5 milliseconds, at 10
> milliseconds its reduced quite a bit and at 15 milliseconds I don't seem
> to have any errors.
>
> 15 milliseconds is still a long time, but at least not as long as 100.

OK, so the issue does not come from the HW after all, great!

Now, my main question is, why are spurious events generated when 
changing the MUX's value? I can understand that we would need to ignore 
the reading that came right after the change, but other than this,  I am 
a bit at a loss.

I am a bit swamped with other tasks right now, but I would love to spend 
more time reviewing your code as I really want to see this upstream!

Martin
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-05-04  9:09 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 14:23 [PATCH 0/9] Enable Gen 7 Observation Architecture Robert Bragg
2016-04-20 14:23 ` [PATCH 1/9] drm/i915: Add i915 perf infrastructure Robert Bragg
2016-04-20 22:41   ` Chris Wilson
2016-04-20 14:23 ` [PATCH 2/9] drm/i915: rename OACONTROL GEN7_OACONTROL Robert Bragg
2016-04-20 14:23 ` [PATCH 3/9] drm/i915: don't whitelist oacontrol in cmd parser Robert Bragg
2016-04-20 14:23 ` [PATCH 4/9] drm/i915: Add 'render basic' Haswell OA unit config Robert Bragg
2016-04-20 14:23 ` [PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-04-20 16:16   ` kbuild test robot
2016-04-20 20:30   ` [Intel-gfx] " kbuild test robot
2016-04-20 21:11   ` Chris Wilson
2016-04-21 16:15     ` Robert Bragg
2016-04-23  8:48       ` Chris Wilson
2016-04-20 22:15   ` Chris Wilson
2016-04-20 22:46   ` Chris Wilson
2016-04-22 11:04     ` Robert Bragg
2016-04-22 11:18       ` Chris Wilson
2016-04-20 22:52   ` Chris Wilson
2016-04-21 15:43     ` Robert Bragg
2016-04-21 16:21       ` Chris Wilson
2016-04-20 23:09   ` Chris Wilson
2016-04-21 15:18     ` Robert Bragg
2016-04-22  1:10       ` Robert Bragg
2016-04-20 23:16   ` Chris Wilson
2016-04-21 15:01     ` Robert Bragg
2016-04-23 10:34   ` Martin Peres
2016-05-03 19:34     ` Robert Bragg
2016-05-03 20:03       ` Robert Bragg
2016-05-04  9:09         ` Martin Peres [this message]
2016-05-04  9:49           ` Robert Bragg
2016-05-04 12:24             ` Daniel Vetter
2016-05-04 13:24               ` Robert Bragg
2016-05-04 13:33                 ` Robert Bragg
2016-05-04 13:51                 ` Daniel Vetter
2016-05-04  9:04       ` [Intel-gfx] " Martin Peres
2016-05-04 11:15         ` Robert Bragg
2016-04-20 14:23 ` [PATCH 6/9] drm/i915: advertise available metrics via sysfs Robert Bragg
2016-04-20 14:23 ` [PATCH 7/9] drm/i915: Add dev.i915.perf_event_paranoid sysctl option Robert Bragg
2016-04-20 14:23 ` [PATCH 8/9] drm/i915: add oa_event_min_timer_exponent sysctl Robert Bragg
2016-04-20 14:23 ` [PATCH 9/9] drm/i915: Add more Haswell OA metric sets Robert Bragg
2016-04-20 14:56 ` [PATCH 0/9] Enable Gen 7 Observation Architecture Robert Bragg

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=03bed47b-28aa-e65e-3658-df0e9046eeee@linux.intel.com \
    --to=martin.peres@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=deepak.s@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=martin.peres@free.fr \
    --cc=robert@sixbynine.org \
    --cc=sourab.gupta@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).