All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t] i915/perf_pmu: Exercise I915_PMU_SOFTWARE_GT_AWAKE_TIME
Date: Thu, 17 Dec 2020 17:39:43 +0000	[thread overview]
Message-ID: <160822678340.13606.1167891500717793691@build.alporthouse.com> (raw)
In-Reply-To: <bf6adb3d-f86e-4a51-b0ff-bd1367a3a3f7@linux.intel.com>

Quoting Tvrtko Ursulin (2020-12-17 17:33:05)
> 
> On 17/12/2020 17:26, Chris Wilson wrote:
> > Measure the sample gt-awake time while each engine and every engine is
> > busy. They should all report the same duration, the elapsed runtime of
> > the batch.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> > ---
> >   include/drm-uapi/i915_drm.h |  3 ++-
> >   tests/i915/perf_pmu.c       | 42 +++++++++++++++++++++++++++++++++++++
> >   2 files changed, 44 insertions(+), 1 deletion(-)
> > 
> > diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
> > index ef696d1a5..bf9ea471c 100644
> > --- a/include/drm-uapi/i915_drm.h
> > +++ b/include/drm-uapi/i915_drm.h
> > @@ -177,8 +177,9 @@ enum drm_i915_pmu_engine_sample {
> >   #define I915_PMU_REQUESTED_FREQUENCY        __I915_PMU_OTHER(1)
> >   #define I915_PMU_INTERRUPTS         __I915_PMU_OTHER(2)
> >   #define I915_PMU_RC6_RESIDENCY              __I915_PMU_OTHER(3)
> > +#define I915_PMU_SOFTWARE_GT_AWAKE_TIME      __I915_PMU_OTHER(4)
> >   
> > -#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
> > +#define I915_PMU_LAST /* Deprecated - do not use */ I915_PMU_RC6_RESIDENCY
> >   
> >   /* Each region is a minimum of 16k, and there are at most 255 of them.
> >    */
> > diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c
> > index c2b186d39..90182074b 100644
> > --- a/tests/i915/perf_pmu.c
> > +++ b/tests/i915/perf_pmu.c
> > @@ -883,6 +883,42 @@ sema_busy(int gem_fd,
> >       close(fd[1]);
> >   }
> >   
> > +static void test_awake(int i915)
> > +{
> > +     const struct intel_execution_engine2 *e;
> > +     unsigned long slept;
> > +     uint64_t val;
> > +     int fd;
> > +
> > +     fd = perf_i915_open(i915, I915_PMU_SOFTWARE_GT_AWAKE_TIME);
> > +     igt_skip_on(fd < 0);
> > +
> > +     /* Check that each engine is captured by the GT wakeref */
> > +     __for_each_physical_engine(i915, e) {
> > +             igt_spin_new(i915, .engine = e->flags);
> > +
> > +             val = pmu_read_single(fd);
> > +             slept = measured_usleep(batch_duration_ns / 1000);
> > +             val = pmu_read_single(fd) - val;
> > +
> > +             gem_quiescent_gpu(i915);
> > +             assert_within_epsilon(val, slept, tolerance);
> > +     }
> > +
> > +     /* And that the total GT wakeref matches walltime not summation */
> > +     __for_each_physical_engine(i915, e)
> > +             igt_spin_new(i915, .engine = e->flags);
> > +
> > +     val = pmu_read_single(fd);
> > +     slept = measured_usleep(batch_duration_ns / 1000);
> > +     val = pmu_read_single(fd) - val;
> > +
> > +     gem_quiescent_gpu(i915);
> > +     assert_within_epsilon(val, slept, tolerance);
> > +
> 
> Erm who terminates all those spinners? :)

gem_quiescent_gpu() calls igt_terminate_spins(). Hmm, I actually thought
it freed them too, but what's a small leak...
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [Intel-gfx] [PATCH i-g-t] i915/perf_pmu: Exercise I915_PMU_SOFTWARE_GT_AWAKE_TIME
Date: Thu, 17 Dec 2020 17:39:43 +0000	[thread overview]
Message-ID: <160822678340.13606.1167891500717793691@build.alporthouse.com> (raw)
In-Reply-To: <bf6adb3d-f86e-4a51-b0ff-bd1367a3a3f7@linux.intel.com>

Quoting Tvrtko Ursulin (2020-12-17 17:33:05)
> 
> On 17/12/2020 17:26, Chris Wilson wrote:
> > Measure the sample gt-awake time while each engine and every engine is
> > busy. They should all report the same duration, the elapsed runtime of
> > the batch.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> > ---
> >   include/drm-uapi/i915_drm.h |  3 ++-
> >   tests/i915/perf_pmu.c       | 42 +++++++++++++++++++++++++++++++++++++
> >   2 files changed, 44 insertions(+), 1 deletion(-)
> > 
> > diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
> > index ef696d1a5..bf9ea471c 100644
> > --- a/include/drm-uapi/i915_drm.h
> > +++ b/include/drm-uapi/i915_drm.h
> > @@ -177,8 +177,9 @@ enum drm_i915_pmu_engine_sample {
> >   #define I915_PMU_REQUESTED_FREQUENCY        __I915_PMU_OTHER(1)
> >   #define I915_PMU_INTERRUPTS         __I915_PMU_OTHER(2)
> >   #define I915_PMU_RC6_RESIDENCY              __I915_PMU_OTHER(3)
> > +#define I915_PMU_SOFTWARE_GT_AWAKE_TIME      __I915_PMU_OTHER(4)
> >   
> > -#define I915_PMU_LAST I915_PMU_RC6_RESIDENCY
> > +#define I915_PMU_LAST /* Deprecated - do not use */ I915_PMU_RC6_RESIDENCY
> >   
> >   /* Each region is a minimum of 16k, and there are at most 255 of them.
> >    */
> > diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c
> > index c2b186d39..90182074b 100644
> > --- a/tests/i915/perf_pmu.c
> > +++ b/tests/i915/perf_pmu.c
> > @@ -883,6 +883,42 @@ sema_busy(int gem_fd,
> >       close(fd[1]);
> >   }
> >   
> > +static void test_awake(int i915)
> > +{
> > +     const struct intel_execution_engine2 *e;
> > +     unsigned long slept;
> > +     uint64_t val;
> > +     int fd;
> > +
> > +     fd = perf_i915_open(i915, I915_PMU_SOFTWARE_GT_AWAKE_TIME);
> > +     igt_skip_on(fd < 0);
> > +
> > +     /* Check that each engine is captured by the GT wakeref */
> > +     __for_each_physical_engine(i915, e) {
> > +             igt_spin_new(i915, .engine = e->flags);
> > +
> > +             val = pmu_read_single(fd);
> > +             slept = measured_usleep(batch_duration_ns / 1000);
> > +             val = pmu_read_single(fd) - val;
> > +
> > +             gem_quiescent_gpu(i915);
> > +             assert_within_epsilon(val, slept, tolerance);
> > +     }
> > +
> > +     /* And that the total GT wakeref matches walltime not summation */
> > +     __for_each_physical_engine(i915, e)
> > +             igt_spin_new(i915, .engine = e->flags);
> > +
> > +     val = pmu_read_single(fd);
> > +     slept = measured_usleep(batch_duration_ns / 1000);
> > +     val = pmu_read_single(fd) - val;
> > +
> > +     gem_quiescent_gpu(i915);
> > +     assert_within_epsilon(val, slept, tolerance);
> > +
> 
> Erm who terminates all those spinners? :)

gem_quiescent_gpu() calls igt_terminate_spins(). Hmm, I actually thought
it freed them too, but what's a small leak...
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-12-17 17:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 17:26 [Intel-gfx] [PATCH i-g-t] i915/perf_pmu: Exercise I915_PMU_SOFTWARE_GT_AWAKE_TIME Chris Wilson
2020-12-17 17:26 ` [igt-dev] " Chris Wilson
2020-12-17 17:33 ` [Intel-gfx] " Tvrtko Ursulin
2020-12-17 17:33   ` [igt-dev] " Tvrtko Ursulin
2020-12-17 17:39   ` Chris Wilson [this message]
2020-12-17 17:39     ` [igt-dev] [Intel-gfx] " Chris Wilson
2020-12-17 17:45     ` Tvrtko Ursulin
2020-12-17 17:45       ` [igt-dev] " Tvrtko Ursulin
2020-12-17 17:45 ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
2020-12-17 17:49   ` Tvrtko Ursulin
2020-12-17 17:49     ` [igt-dev] " Tvrtko Ursulin
2020-12-17 18:40 ` [igt-dev] ✓ Fi.CI.BAT: success for i915/perf_pmu: Exercise I915_PMU_SOFTWARE_GT_AWAKE_TIME (rev2) Patchwork

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=160822678340.13606.1167891500717793691@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.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 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.