public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Optimistically spin for the request completion
Date: Wed, 11 Mar 2015 11:13:59 +0100	[thread overview]
Message-ID: <20150311101359.GG3800@phenom.ffwll.local> (raw)
In-Reply-To: <20150310161414.GC28952@nuc-i3427.alporthouse.com>

On Tue, Mar 10, 2015 at 04:14:14PM +0000, Chris Wilson wrote:
> On Tue, Mar 10, 2015 at 04:06:19PM +0000, Chris Wilson wrote:
> > @@ -1235,12 +1257,20 @@ int __i915_wait_request(struct drm_i915_gem_request *req,
> >  	if (ring->id == RCS && INTEL_INFO(dev)->gen >= 6)
> >  		gen6_rps_boost(dev_priv, file_priv);
> >  
> > -	if (!irq_test_in_progress && WARN_ON(!ring->irq_get(ring)))
> > -		return -ENODEV;
> > -
> >  	/* Record current time in case interrupted by signal, or wedged */
> >  	trace_i915_gem_request_wait_begin(req);
> >  	before = ktime_get_raw_ns();
> > +
> > +	/* Optimistic spin before touching IRQs */
> Perhaps iff timeout == NULL, or pass it along and add a
> 
> if (timeout && timeout_after_eq(jiffies, timeout))
> 	break;
> 
> before the cpu_relax()?

I guess the answer for that is asking how many apps use short
opportunistic waits in the frame rendering loop, e.g. to wait for query
results and fall back to the ones from the previous frame if they're not
available?

Also do you have microbenchmark numbers for something midly ridiculous
like a loop of very short batches (enough ofc to cause a bit of delay) and
immediately stalling for them? It's definitely an awesome idea given that
every other lock and sync primitive does it too.
-Daniel
> 
> > +	ret = __i915_spin_request(req);
> > +	if (ret == 0)
> > +		goto out;
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-11 10:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 16:06 [PATCH] drm/i915: Optimistically spin for the request completion Chris Wilson
2015-03-10 16:14 ` Chris Wilson
2015-03-11 10:13   ` Daniel Vetter [this message]
2015-03-11 10:30     ` Chris Wilson
2015-03-11 15:24       ` Chris Wilson
2015-03-11  1:56 ` shuang.he

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=20150311101359.GG3800@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --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