From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tests/gem_exec_nop: Remove submission batching
Date: Mon, 11 May 2020 10:51:12 +0200 [thread overview]
Message-ID: <c391b824f21dd36956fbf95740e9ea4ba7548a24.camel@linux.intel.com> (raw)
In-Reply-To: <158896045063.30605.10719204340280805143@build.alporthouse.com>
Hi Chris,
On Fri, 2020-05-08 at 18:54 +0100, Chris Wilson wrote:
> Quoting Janusz Krzysztofik (2020-05-08 14:56:31)
> > static double nop_on_ring(int fd, uint32_t handle,
> > const struct intel_execution_engine2 *e, int timeout,
> > - unsigned long *out)
> > + unsigned long *count)
> > {
> > struct drm_i915_gem_execbuffer2 execbuf;
> > struct drm_i915_gem_exec_object2 obj;
> > struct timespec start, now;
> > - unsigned long count;
> > + unsigned long total;
> > +
> > + igt_assert(*count);
> >
> > memset(&obj, 0, sizeof(obj));
> > obj.handle = handle;
> > @@ -93,18 +95,18 @@ static double nop_on_ring(int fd, uint32_t handle,
> > }
> > intel_detect_and_clear_missed_interrupts(fd);
> >
> > - count = 0;
> > + total = 0;
> > clock_gettime(CLOCK_MONOTONIC, &start);
> > do {
> > - for (int loop = 0; loop < 1024; loop++)
> > + for (int loop = 0; loop < *count; loop++)
>
> This unnerves me. I expect to get this wrong when writing new callers.
>
> There's no great reason to even have 1024 here, we can survive with
> doing clock_gettime() every iteration, and just accept it as part of the
> systematic cost.
Thanks for fixing this and merging the change.
Following our discussion on IRC which I probably didn't understand
precisely enough but maybe have a better understanding now after having
it reread, how about still addressing the "headless" requirement for
better precision with the following hunk?
@@ -373,10 +372,12 @@ stable_nop_on_ring(int fd, uint32_t handle,
while (reps--) {
unsigned long count;
double time;
time = nop_on_ring(fd, handle, e, timeout, &count);
+ igt_skip_on_f(count < 1000 * timeout,
+ "submicrosecond precision of time measurement\n");
igt_stats_push_float(&s, time / count);
}
n = igt_stats_get_median(&s);
igt_stats_fini(&s);
Thanks,
Janusz
> >
> > - count += 1024;
> > + total += *count;
> > clock_gettime(CLOCK_MONOTONIC, &now);
> > } while (elapsed(&start, &now) < timeout);
> > igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0);
> >
> > - *out = count;
> > + *count = total;
> > return elapsed(&start, &now);
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-05-11 8:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 13:56 [igt-dev] [PATCH i-g-t 0/2] tests/gem_exec_nop: Remove submission batching Janusz Krzysztofik
2020-05-08 13:56 ` [igt-dev] [PATCH i-g-t 1/2] tests/gem_exec_nop: Kill obsolete pass/fail metric Janusz Krzysztofik
2020-05-08 17:46 ` Chris Wilson
2020-05-08 13:56 ` [igt-dev] [PATCH i-g-t 2/2] tests/gem_exec_nop: Remove submission batching Janusz Krzysztofik
2020-05-08 17:54 ` Chris Wilson
2020-05-11 8:51 ` Janusz Krzysztofik [this message]
2020-05-11 9:30 ` [igt-dev] [Intel-gfx] " Chris Wilson
2020-05-08 14:35 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-05-08 17:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=c391b824f21dd36956fbf95740e9ea4ba7548a24.camel@linux.intel.com \
--to=janusz.krzysztofik@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox