igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATH i-g-t 04/13] gem_wsim: Check sleep times
Date: Fri, 7 Sep 2018 17:13:55 +0300	[thread overview]
Message-ID: <20180907141355.GC5565@intel.com> (raw)
In-Reply-To: <153630991479.16893.7615465871101432757@skylake-alporthouse-com>

On Fri, Sep 07, 2018 at 09:45:14AM +0100, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-09-07 09:37:00)
> > 
> > On 05/09/2018 15:09, Ville Syrjälä wrote:
> > > On Wed, Sep 05, 2018 at 02:49:30PM +0100, Tvrtko Ursulin wrote:
> > >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > >>
> > >> Notice in more places if we are running behind.
> > >>
> > >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > >> ---
> > >>   benchmarks/gem_wsim.c | 52 ++++++++++++++++++++++++++++++++++++++-----
> > >>   1 file changed, 46 insertions(+), 6 deletions(-)
> > >>
> > >> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> > >> index 25af4d678ba4..b05e9760f419 100644
> > >> --- a/benchmarks/gem_wsim.c
> > >> +++ b/benchmarks/gem_wsim.c
> > >> @@ -1718,6 +1718,21 @@ static bool sync_deps(struct workload *wrk, struct w_step *w)
> > >>      return synced;
> > >>   }
> > >>   
> > >> +static unsigned int measured_usleep(unsigned int usec)
> > >> +{
> > >> +    struct timespec ts = { };
> > >> +    unsigned int slept;
> > >> +
> > >> +    slept = igt_nsec_elapsed(&ts);
> > >> +    igt_assert(slept == 0);
> > >> +    do {
> > >> +            usleep(usec - slept);
> > >> +            slept = igt_nsec_elapsed(&ts) / 1000;
> > >> +    } while (slept < usec);
> > > 
> > > clock_nanosleep(ABS)?
> > 
> > Hm I think I see what you mean. Rather than a relative sleep trying to 
> > hit the loop period, ask from the kernel (or glibc, I don't know who 
> > implements it) to sleep until an absolute target. This totally makes 
> > sense and would simplify the code from one angle, I am just not sure if 
> > absolute sleep can be relied upon any better to not oversleep. Well, 
> > actually for scheduling delays not to affect the caller. However maybe 
> > it doesn't matter since AFAIR my main problem were dropped period due 
> > GPU activity (the first pair of warning messages in the patch), and 
> > again AFAIR, it was quite hard to hit the second ones.
> 
> Right, it removes the loop but we still want to keep the measurement.

I guess we still want a loop if we're worried about signals? Not sure
why else we'd need a loop anyway. But the loop could be just something
like 'while (clock_nanosleep()) ;'

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-09-07 14:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 13:49 [Intel-gfx] [PATH i-g-t 00/13] Tracing & workload simulation misc patches Tvrtko Ursulin
2018-09-05 13:49 ` [Intel-gfx] [PATH i-g-t 01/13] trace.pl: Fix frequency timeline Tvrtko Ursulin
2018-09-05 13:49 ` [Intel-gfx] [PATH i-g-t 02/13] trace.pl: Use undocumented -o to perf record to allow tee Tvrtko Ursulin
2018-09-05 13:49 ` [Intel-gfx] [PATH i-g-t 03/13] gem_wsim: Fix BCS usage under VCS2 remap warning Tvrtko Ursulin
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 04/13] gem_wsim: Check sleep times Tvrtko Ursulin
2018-09-05 14:09   ` Ville Syrjälä
2018-09-07  8:37     ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-09-07  8:45       ` Chris Wilson
2018-09-07 14:13         ` Ville Syrjälä [this message]
2018-09-07 16:00           ` [Intel-gfx] [igt-dev] " Tvrtko Ursulin
2018-09-05 13:49 ` [Intel-gfx] [PATH i-g-t 05/13] gem_wsim: Make workload commands case sensitive Tvrtko Ursulin
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 06/13] gem_wsim: Context priority support Tvrtko Ursulin
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 07/13] gem_wsim: Make batches preemptable by default Tvrtko Ursulin
2018-09-07  8:48   ` Chris Wilson
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 08/13] gem_wsim: Per context preemption point control Tvrtko Ursulin
2018-09-07  8:49   ` Chris Wilson
2018-09-07  8:51     ` [Intel-gfx] " Chris Wilson
2018-09-05 13:49 ` [Intel-gfx] [PATH i-g-t 09/13] media-bench: Update for engine=class:instance tracepoints Tvrtko Ursulin
2018-09-05 13:49 ` [Intel-gfx] [PATH i-g-t 10/13] media-bench: Protect against incorrect -b syntax Tvrtko Ursulin
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 11/13] media-bench: Fix tracing of direct workloads Tvrtko Ursulin
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 12/13] media-bench: Write out trace files directly Tvrtko Ursulin
2018-09-05 13:49 ` [igt-dev] [PATH i-g-t 13/13] media-bench: Add mixed mode evaluation Tvrtko Ursulin
2018-09-05 15:24 ` [igt-dev] ✓ Fi.CI.BAT: success for Tracing & workload simulation misc patches Patchwork
2018-09-05 20:38 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20180907141355.GC5565@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@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;
as well as URLs for NNTP newsgroup(s).