[PATCH v4] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

Naveen N. Rao naveen.n.rao at linux.vnet.ibm.com
Tue Oct 10 20:30:34 AEDT 2017


On 2017/10/10 09:03AM, Santosh Sivaraj wrote:
> * Naveen N. Rao <naveen.n.rao at linux.vnet.ibm.com> wrote (on 2017-10-09 10:39:18 +0000):
> 
> > On 2017/10/09 08:09AM, Santosh Sivaraj wrote:

[snip]

> > > +	add     r3,r3,r0
> > > +	ld      r0,CFG_TB_UPDATE_COUNT(r3)
> > > +	cmpld   cr0,r0,r8               /* check if updated */
> > > +	bne-    70b
> > 
> > I also notice that the code for dealing with CLOCK_MONOTONIC is similar 
> > for _COARSE and regular clocks. If possible, we should reuse that as 
> > well.
> >
> In this case we will be adding more checks and branches in order to reuse
> the code. If we want to keep the code common we will have to do a lot of
> jumping around, code will contain a bunch of branches, which I feel will make
> the code/flow hard to understand. (Q: Does lot of branches have bad effect on
> branch prediction?)

Right - like we discussed offline, if it hurts readability, that's a 
good enough reason not to do this. We are only talking about a few 
instructions here anyway, so no need to worry too much.

- Naveen



More information about the Linuxppc-dev mailing list