Re: [PATCH] drm/i915: Use usleep_range() in wait_for()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 20, 2015 at 09:28:08PM +0200, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxxxx>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

Hmm, I think we can improve further with a more variable sleep. The
maximum we pass to wait_for() is usually plucked from somewhere in the
spec (or is just a safety factor). Either way, it is a good guide as to
how to actually sleep for - if say we try to only sample 1000 times up
to the maximum:

if (do_sleep && drm_can_sleep()) {
	usleep_range((MS), 10*(MS));
}

So whilst you have a situation where we clearly sleep too long between
sampling (a register), it would be beneficial to start adding some debug
infrastructure. Or even better if usleep_range already does it for us...
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux