Re: [PATCH] drm/i915: Only expand COND once in wait_for()

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

 



On Wed, Sep 14, 2016 at 03:53:32PM -0300, Paulo Zanoni wrote:
> Em Qua, 2016-09-14 às 13:10 +0100, Dave Gordon escreveu:
> > Commentary from Chris Wilson's original version:
> > 
> > > 
> > > I was looking at some wait_for() timeouts on a slow system, with
> > > lots of
> > > debug enabled (KASAN, lockdep, mmio_debug). Thinking that we were
> > > mishandling the timeout, I tried to ensure that we loop at least
> > > once
> > > after first testing COND. However, the double test of COND either
> > > side
> > > of the timeout check makes that unlikely. But we can do an
> > > equivalent
> > > loop, that keeps the COND check after testing for timeout (required
> > > so
> > > that we are not preempted between testing COND and then testing for
> > > a
> > > timeout) without expanding COND twice.
> > > 
> > > The advantage of only expanding COND once is a dramatic reduction
> > > in
> > > code size:
> > > 
> > >    text	   data	    bss	    dec	    hex
> > >    1308733	   5184	   1152	1315069	 141
> > > 0fd	before
> > >    1305341	   5184	   1152	1311677	 140
> > > 3bd	after
> > 
> > but it turned out that due to a missing iniitialiser, gcc had "gone
> > wild trimming undefined code" :( This version acheives a rather more
> > modest (but still worthwhile) gain of ~550 bytes.
> > 
> > Signed-off-by: Dave Gordon <david.s.gordon@xxxxxxxxx>
> > Original-idea-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Zanoni, Paulo R <paulo.r.zanoni@xxxxxxxxx>
> 
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>

Thanks for the improvement and review, pushed.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://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