Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 6/7] benchmarks/gem_exec_fault: Add timeout argument
Date: Thu, 14 Oct 2021 00:30:43 -0700	[thread overview]
Message-ID: <87v920gj18.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20211014074739.GD3617@zkempczy-mobl2>

On Thu, 14 Oct 2021 00:47:39 -0700, Zbigniew Kempczyński wrote:
> On Wed, Oct 13, 2021 at 09:24:18PM -0700, Dixit, Ashutosh wrote:
> > On Thu, 07 Oct 2021 23:54:31 -0700, Zbigniew Kempczyński 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 reps, int ncpus, unsigned flag
> > >					/* fault out */
> > >					obj.alignment = 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) >= timeout) {
> > > +						timeout = -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:
>
> I just wanted to avoid calling elapsed() twice, that's why I changed to
> simpler expression. Timeout cannot be negative so it is good as stop
> condition to outer loop.
>
> I dare get your r-b here.

Sure, just a matter of personal preference. Already R-b.

>
> --
> Zbigniew
>
> >
> > Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> >
> > > +						break;
> > > +					}
> > > +				}
> > > +			} while (timeout > 0);
> > >
> > >			gem_sync(fd, obj.handle);
> > >			clock_gettime(CLOCK_MONOTONIC, &end);

  reply	other threads:[~2021-10-14  7:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  6:54 [igt-dev] [PATCH i-g-t 0/7] Prepare IGTs to allow only zero alignment Zbigniew Kempczyński
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 1/7] lib/gem_submission: Add kernel exec object alignment capability Zbigniew Kempczyński
2021-10-13  4:47   ` Dixit, Ashutosh
2021-10-13  5:27     ` Zbigniew Kempczyński
2021-10-14  2:26       ` Dixit, Ashutosh
2021-10-14  7:14         ` Zbigniew Kempczyński
2021-10-14  7:22           ` Dixit, Ashutosh
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 2/7] lib/intel_batchbuffer: Detect and use kernel " Zbigniew Kempczyński
2021-10-14  2:37   ` Dixit, Ashutosh
2021-10-14  7:25     ` Zbigniew Kempczyński
2021-10-14  7:22       ` Dixit, Ashutosh
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 3/7] tests/gem_exec_alignment: Add prerequisite alignment condition Zbigniew Kempczyński
2021-10-14  4:12   ` Dixit, Ashutosh
2021-10-14  7:27     ` Zbigniew Kempczyński
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 4/7] tests/gem_evict_alignment: Skip if kernel doesn't support passing alignment Zbigniew Kempczyński
2021-10-14  4:14   ` Dixit, Ashutosh
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 5/7] tests/i915_pm_rpm: Fix invalid alignment Zbigniew Kempczyński
2021-10-14  4:18   ` Dixit, Ashutosh
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 6/7] benchmarks/gem_exec_fault: Add timeout argument Zbigniew Kempczyński
2021-10-14  4:24   ` Dixit, Ashutosh
2021-10-14  7:47     ` Zbigniew Kempczyński
2021-10-14  7:30       ` Dixit, Ashutosh [this message]
2021-10-08  6:54 ` [igt-dev] [PATCH i-g-t 7/7] benchmarks/gem_exec_fault: Add softpin mode to support gens with ppgtt Zbigniew Kempczyński
2021-10-14  5:01   ` Dixit, Ashutosh
2021-10-14  5:06     ` Dixit, Ashutosh
2021-10-14  8:11     ` Zbigniew Kempczyński
2021-10-08  7:48 ` [igt-dev] ✓ Fi.CI.BAT: success for Prepare IGTs to allow only zero alignment Patchwork
2021-10-08  9:02 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-10-14  8:19 [igt-dev] [PATCH i-g-t 0/7] " Zbigniew Kempczyński
2021-10-14  8:19 ` [igt-dev] [PATCH i-g-t 6/7] benchmarks/gem_exec_fault: Add timeout argument Zbigniew Kempczyński

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=87v920gj18.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    --cc=zbigniew.kempczynski@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