From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: From: Janusz Krzysztofik Date: Mon, 11 May 2020 10:51:12 +0200 In-Reply-To: <158896045063.30605.10719204340280805143@build.alporthouse.com> References: <20200508135631.8099-1-janusz.krzysztofik@linux.intel.com> <20200508135631.8099-3-janusz.krzysztofik@linux.intel.com> <158896045063.30605.10719204340280805143@build.alporthouse.com> MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tests/gem_exec_nop: Remove submission batching List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Chris Wilson , igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org List-ID: 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