From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id E33146E8A5 for ; Thu, 14 Oct 2021 04:41:47 +0000 (UTC) Date: Wed, 13 Oct 2021 21:24:18 -0700 Message-ID: <8735p4i68d.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211008065432.15482-7-zbigniew.kempczynski@intel.com> References: <20211008065432.15482-1-zbigniew.kempczynski@intel.com> <20211008065432.15482-7-zbigniew.kempczynski@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Subject: Re: [igt-dev] [PATCH i-g-t 6/7] benchmarks/gem_exec_fault: Add timeout argument List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= Cc: igt-dev@lists.freedesktop.org, Petri Latvala List-ID: On Thu, 07 Oct 2021 23:54:31 -0700, Zbigniew Kempczy=F1ski wrote: > > +static int loop(uint64_t size, unsigned ring, int reps, int ncpus, > + unsigned flags, float timeout) > { > struct drm_i915_gem_execbuffer2 execbuf; > struct drm_i915_gem_exec_object2 obj; > @@ -128,10 +130,14 @@ static int loop(uint64_t size, unsigned ring, int r= eps, int ncpus, unsigned flag > /* fault out */ > obj.alignment =3D 1ull << 63; > __gem_execbuf(fd, &execbuf); > - } > > - clock_gettime(CLOCK_MONOTONIC, &end); > - } while (elapsed(&start, &end) < 2.); > + clock_gettime(CLOCK_MONOTONIC, &end); > + if (elapsed(&start, &end) >=3D timeout) { > + timeout =3D -1.0; Just a small nit, I don't think we need to set it to -1 here. We can just leave the "while (elapsed(&start, &end) < timeout);" check in the outer loop too. So please change if you agree. Otherwise: Reviewed-by: Ashutosh Dixit > + break; > + } > + } > + } while (timeout > 0); > > gem_sync(fd, obj.handle); > clock_gettime(CLOCK_MONOTONIC, &end);