From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincenzo Frascino Subject: Re: [PATCHv8 02/34] lib/vdso: make do_hres and do_coarse as __always_inline Date: Fri, 10 Jan 2020 12:18:15 +0000 Message-ID: <8c3f5263-070d-9308-0dbf-ed65efed1734@arm.com> References: <20191112012724.250792-1-dima@arista.com> <20191112012724.250792-3-dima@arista.com> <878smfa66i.fsf@nanos.tec.linutronix.de> <875zhja59q.fsf@nanos.tec.linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <875zhja59q.fsf-ecDvlHI5BZPZikZi3RtOZ1XZhhPuCNm+@public.gmane.org> Content-Language: en-US Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thomas Gleixner , Dmitry Safonov , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Dmitry Safonov <0x7f454c46-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, Andrei Vagin , Adrian Reber , Andrei Vagin , Andy Lutomirski , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, criu-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: linux-api@vger.kernel.org On 1/10/20 12:02 PM, Thomas Gleixner wrote: > Vincenzo Frascino writes: >> On 1/10/20 11:42 AM, Thomas Gleixner wrote: >>>>> +» » /*·goto·allows·to·avoid·extra·inlining·of·do_hres.·*/ >>>>> +» » goto·out_hres; >>>> >>>> What is the performance impact of "goto out_hres"? >>> >>> On x86 it's invisible at least in my limited testing. >> >> On arm64 as well based on mine as well. Shall we keep the code more readable >> here (without goto)? > > The delta patch below makes it readable again and also avoids the double > inlining. Quick testing shows no difference. > I tested it on arm64 and it does not show any difference as well. I vote for it :) > Thanks, > > tglx > > 8<--------------- > --- a/lib/vdso/gettimeofday.c > +++ b/lib/vdso/gettimeofday.c > @@ -98,17 +98,15 @@ static __maybe_unused int > msk = 1U << clock; > if (likely(msk & VDSO_HRES)) { > vd = &vd[CS_HRES_COARSE]; > -out_hres: > - return do_hres(vd, clock, ts); > } else if (msk & VDSO_COARSE) { > do_coarse(&vd[CS_HRES_COARSE], clock, ts); > return 0; > } else if (msk & VDSO_RAW) { > vd = &vd[CS_RAW]; > - /* This goto avoids extra inlining of do_hres. */ > - goto out_hres; > + } else { > + return -1; > } > - return -1; > + return do_hres(vd, clock, ts); > } > > static __maybe_unused int > -- Regards, Vincenzo