From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Use usleep_range() in wait_for()
Date: Mon, 23 Mar 2015 10:30:50 +0100 [thread overview]
Message-ID: <20150323093050.GO1349@phenom.ffwll.local> (raw)
In-Reply-To: <550C7584.1000903@virtuousgeek.org>
On Fri, Mar 20, 2015 at 12:31:16PM -0700, Jesse Barnes wrote:
> On 03/20/2015 12:28 PM, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > msleep() can sleep for way too long, so switch wait_for() to use
> > usleep_range() instead. Following a totally unscientific method
> > I just picked the range as W-2W.
> >
> > This cuts the i915 init time on my BSW to almost half:
> > - initcall i915_init+0x0/0xa8 [i915] returned 0 after 419977 usecs
> > + initcall i915_init+0x0/0xa8 [i915] returned 0 after 238419 usecs
> >
> > Note that I didn't perform any other benchmarks on this so far.
> >
> > Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_drv.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 6f20f3a..d2a4de0 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -56,8 +56,8 @@
> > ret__ = -ETIMEDOUT; \
> > break; \
> > } \
> > - if (W && drm_can_sleep()) { \
> > - msleep(W); \
> > + if ((W) && drm_can_sleep()) { \
> > + usleep_range((W)*1000, (W)*2000); \
> > } else { \
> > cpu_relax(); \
> > } \
> >
>
> Nice improvement! I guess it's just because usleep_range() uses an
> hrtimeout, but since we have the added slop of the range it may actually
> be an improvement, power-wise too.
>
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Nice indeed. Queued for -next, thanks for the patch.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-23 9:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 19:28 [PATCH] drm/i915: Use usleep_range() in wait_for() ville.syrjala
2015-03-20 19:31 ` Jesse Barnes
2015-03-23 9:30 ` Daniel Vetter [this message]
2015-03-20 21:09 ` Chris Wilson
2015-03-23 9:39 ` Ville Syrjälä
2015-03-23 9:46 ` Daniel Vetter
2015-03-20 23:38 ` 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=20150323093050.GO1349@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.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