From: Vincenzo Frascino <vincenzo.frascino@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch <linux-arch@vger.kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Will Deacon <will.deacon@arm.com>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Ralf Baechle <ralf@linux-mips.org>,
Mark Salyzyn <salyzyn@android.com>,
Paul Burton <paul.burton@mips.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Collingbourne <pcc@google.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 07/27] arm64: Substitute gettimeofday with C implementation
Date: Fri, 23 Nov 2018 10:49:28 +0000 [thread overview]
Message-ID: <f283de36-b620-03f0-b97b-fd63900e33ce@arm.com> (raw)
In-Reply-To: <CAK8P3a0ht6TjXubYiWaLh96hOGy3FH_K=JJVhQrYV3D+z-JqBA@mail.gmail.com>
On 11/14/18 5:47 PM, Arnd Bergmann wrote:
> On Tue, Nov 13, 2018 at 2:58 AM Vincenzo Frascino
> <vincenzo.frascino@arm.com> wrote:
>>
>> On 09/11/2018 16:13, Arnd Bergmann wrote:
>
>>>> diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
>>>> index beca249bc2f3..9de0ffc369c5 100644
>>>> --- a/arch/arm64/kernel/vdso/vdso.lds.S
>>>> +++ b/arch/arm64/kernel/vdso/vdso.lds.S
>>>> @@ -88,6 +88,7 @@ VERSION
>>>> __kernel_gettimeofday;
>>>> __kernel_clock_gettime;
>>>> __kernel_clock_getres;
>>>> + __kernel_time;
>>>> local: *;
>>>> };
>>>> }
>>>
>>> I would prefer to not add any deprecated interfaces in the VDSO. If we
>>> have the 64-bit version of clock_gettime, we don't need the 32-bit version
>>> of it, and we don't need gettimeofday() or time() either. The C library
>>> can easily implement those by calling into clock_gettime.
>>>
>>
>> I like the idea, this would make the vdso lib code more simple and more maintainable.
>>
>> In this patchset I tried to cover the widest possible scenario making things configurable: each architecture can select and enable exactly what it needs from the vdso common code.
>>
>> Based on what you are proposing, once the C library will implement things in this way, it will be easy to deprecate and remove the unused code.
>
> Just to clarify: we can never remove interfaces that an older version of the
> C library was using. What I'm asking is that we don't introduce any of the
> unnecessary ones for architectures that don't already have them.
>
I agree, I realize now I should have worded my answer differently. With
"deprecate and remove the unused code" was referring to redirect gettimeofday
through clock_gettime, not to remove completely gettimeofday interface since
this would cause userspace breakage for old C libraries as you are pointing out
as well.
>> I am not familiar with the development plans of the various C libraries, but looking at
>> bionic libc currently seems using all the vdso exposed functions [1].
>>
>> [1] https://github.com/aosp-mirror/platform_bionic/blob/master/libc/bionic/vdso.cpp
>
> It looks like this implementation checks for each one of them to be present
> first and then uses a fallback implementation if it does not exist. This would
> clearly let us remove the handlers we don't want to support, but there
> are two possible downsides:
>> - some other libc might be lacking that fallback path
> - the fallback might be much slower, e.g. time() should fallback to
> the vdso version of clock_gettime(CLOCK_REALTIME_COARSE) for
> best performance, rather than the time() syscall or CLOCK_REALTIME.
>
> So I'd argue that if an architecture already has a time() vdso implementation,
> we probably want to keep that entry point but make it point to the best
> generic implementation (i.e. clock_gettime CLOCK_REALTIME_COARSE).
What I was trying to point out here is that if the symbol is present in the vdso
library the C library implementation tends to prefer to use it.
Said that, I agree with what you are saying and in this first iteration I will
make sure that we do not add new symbols for the architectures that did not
support them previously, but I will keep the library the most generic possible,
I would prefer though to introduce the redirection for gettimeofday() and time()
to the best performing clock_gettime() at a later stage (and with a separate
patchset) because it would involve some cleanup in the vdso.c of the
architectures that would use the library (i.e. update_vsyscall_tz() not required
anymore) and because based on what I measured with a quick test the performance
difference seems small with the current implementation of the library.
>
> Arnd
>
--
Regards,
Vincenzo
WARNING: multiple messages have this Message-ID (diff)
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch <linux-arch@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Ralf Baechle <ralf@linux-mips.org>,
Paul Burton <paul.burton@mips.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Mark Salyzyn <salyzyn@android.com>,
Peter Collingbourne <pcc@google.com>
Subject: Re: [PATCH 07/27] arm64: Substitute gettimeofday with C implementation
Date: Fri, 23 Nov 2018 10:49:28 +0000 [thread overview]
Message-ID: <f283de36-b620-03f0-b97b-fd63900e33ce@arm.com> (raw)
Message-ID: <20181123104928.jRbUQbADXX0i_A4yVxjOBTOXzdcwzh-8Z3BH3ekR44A@z> (raw)
In-Reply-To: <CAK8P3a0ht6TjXubYiWaLh96hOGy3FH_K=JJVhQrYV3D+z-JqBA@mail.gmail.com>
On 11/14/18 5:47 PM, Arnd Bergmann wrote:
> On Tue, Nov 13, 2018 at 2:58 AM Vincenzo Frascino
> <vincenzo.frascino@arm.com> wrote:
>>
>> On 09/11/2018 16:13, Arnd Bergmann wrote:
>
>>>> diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
>>>> index beca249bc2f3..9de0ffc369c5 100644
>>>> --- a/arch/arm64/kernel/vdso/vdso.lds.S
>>>> +++ b/arch/arm64/kernel/vdso/vdso.lds.S
>>>> @@ -88,6 +88,7 @@ VERSION
>>>> __kernel_gettimeofday;
>>>> __kernel_clock_gettime;
>>>> __kernel_clock_getres;
>>>> + __kernel_time;
>>>> local: *;
>>>> };
>>>> }
>>>
>>> I would prefer to not add any deprecated interfaces in the VDSO. If we
>>> have the 64-bit version of clock_gettime, we don't need the 32-bit version
>>> of it, and we don't need gettimeofday() or time() either. The C library
>>> can easily implement those by calling into clock_gettime.
>>>
>>
>> I like the idea, this would make the vdso lib code more simple and more maintainable.
>>
>> In this patchset I tried to cover the widest possible scenario making things configurable: each architecture can select and enable exactly what it needs from the vdso common code.
>>
>> Based on what you are proposing, once the C library will implement things in this way, it will be easy to deprecate and remove the unused code.
>
> Just to clarify: we can never remove interfaces that an older version of the
> C library was using. What I'm asking is that we don't introduce any of the
> unnecessary ones for architectures that don't already have them.
>
I agree, I realize now I should have worded my answer differently. With
"deprecate and remove the unused code" was referring to redirect gettimeofday
through clock_gettime, not to remove completely gettimeofday interface since
this would cause userspace breakage for old C libraries as you are pointing out
as well.
>> I am not familiar with the development plans of the various C libraries, but looking at
>> bionic libc currently seems using all the vdso exposed functions [1].
>>
>> [1] https://github.com/aosp-mirror/platform_bionic/blob/master/libc/bionic/vdso.cpp
>
> It looks like this implementation checks for each one of them to be present
> first and then uses a fallback implementation if it does not exist. This would
> clearly let us remove the handlers we don't want to support, but there
> are two possible downsides:
>> - some other libc might be lacking that fallback path
> - the fallback might be much slower, e.g. time() should fallback to
> the vdso version of clock_gettime(CLOCK_REALTIME_COARSE) for
> best performance, rather than the time() syscall or CLOCK_REALTIME.
>
> So I'd argue that if an architecture already has a time() vdso implementation,
> we probably want to keep that entry point but make it point to the best
> generic implementation (i.e. clock_gettime CLOCK_REALTIME_COARSE).
What I was trying to point out here is that if the symbol is present in the vdso
library the C library implementation tends to prefer to use it.
Said that, I agree with what you are saying and in this first iteration I will
make sure that we do not add new symbols for the architectures that did not
support them previously, but I will keep the library the most generic possible,
I would prefer though to introduce the redirection for gettimeofday() and time()
to the best performing clock_gettime() at a later stage (and with a separate
patchset) because it would involve some cleanup in the vdso.c of the
architectures that would use the library (i.e. update_vsyscall_tz() not required
anymore) and because based on what I measured with a quick test the performance
difference seems small with the current implementation of the library.
>
> Arnd
>
--
Regards,
Vincenzo
next prev parent reply other threads:[~2018-11-23 10:49 UTC|newest]
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-09 12:37 [PATCH 00/27] Unify vDSOs across more architectures Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 01/27] kernel: Standardize vdso_datapage Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 02/27] kernel: Add Monotonic boot time support Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 03/27] kernel: Add International Atomic Time support Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 04/27] kernel: Add masks support for Raw and NTP time Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 05/27] kernel: Add clock_mode support Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 06/27] kernel: Define gettimeofday vdso common code Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 16:05 ` Arnd Bergmann
2018-11-09 16:05 ` Arnd Bergmann
2018-11-13 10:21 ` Vincenzo Frascino
2018-11-13 10:21 ` Vincenzo Frascino
2018-11-10 16:18 ` Arnd Bergmann
2018-11-10 16:18 ` Arnd Bergmann
2018-11-13 10:24 ` Vincenzo Frascino
2018-11-13 10:24 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 07/27] arm64: Substitute gettimeofday with C implementation Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 16:13 ` Arnd Bergmann
2018-11-09 16:13 ` Arnd Bergmann
2018-11-09 17:23 ` Mark Salyzyn
2018-11-09 17:23 ` Mark Salyzyn
2018-11-09 21:13 ` Arnd Bergmann
2018-11-09 21:13 ` Arnd Bergmann
2018-11-13 10:58 ` Vincenzo Frascino
2018-11-13 10:58 ` Vincenzo Frascino
2018-11-14 17:47 ` Arnd Bergmann
2018-11-14 17:47 ` Arnd Bergmann
2018-11-23 10:49 ` Vincenzo Frascino [this message]
2018-11-23 10:49 ` Vincenzo Frascino
2018-11-23 11:14 ` Arnd Bergmann
2018-11-23 11:14 ` Arnd Bergmann
2018-11-09 18:09 ` Peter Collingbourne
2018-11-09 18:09 ` Peter Collingbourne
2018-11-13 10:36 ` Vincenzo Frascino
2018-11-13 10:36 ` Vincenzo Frascino
2018-11-10 0:29 ` David Miller
2018-11-10 0:29 ` David Miller
2018-11-12 18:21 ` Mark Salyzyn
2018-11-12 18:21 ` Mark Salyzyn
2018-11-14 10:22 ` Vincenzo Frascino
2018-11-14 10:22 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 08/27] arm64: compat: Alloc separate pages for vectors and sigpage Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 09/27] arm64: compat: Split kuser32 Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 10/27] arm64: compat: Refactor aarch32_alloc_vdso_pages() Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 11/27] arm64: compat: Add KUSER_HELPERS config option Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 12/27] arm64: compat: Add missing syscall numbers Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 13/27] arm64: compat: Expose signal related structures Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 14/27] arm64: compat: Generate asm offsets for signals Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 15/27] lib: vdso: Add compat support Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 16/27] arm64: compat: Add vDSO Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 16:23 ` Arnd Bergmann
2018-11-09 16:23 ` Arnd Bergmann
2018-11-09 12:37 ` [PATCH 17/27] arm64: Refactor vDSO code Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 18/27] arm64: compat: vDSO setup for compat layer Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 19/27] arm64: elf: vDSO code page discovery Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 20/27] arm64: compat: Get sigreturn trampolines from vDSO Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 21/27] arm64: Add vDSO compat support Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 22/27] arm64: Enable compat vDSO support Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 23/27] arm: Add support for generic vDSO Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 16:27 ` Arnd Bergmann
2018-11-09 16:27 ` Arnd Bergmann
2018-11-09 12:37 ` [PATCH 24/27] mips: Introduce vdso_direct Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 25/27] clock: csrc-4k: Add support for vdso_direct Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 26/27] clock: gic-timer: " Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 27/27] mips: Add support for generic vDSO Vincenzo Frascino
2018-11-09 12:37 ` Vincenzo Frascino
2018-11-10 16:33 ` [PATCH 00/27] Unify vDSOs across more architectures Arnd Bergmann
2018-11-10 16:33 ` Arnd Bergmann
2018-11-23 11:05 ` Vincenzo Frascino
2018-11-23 11:05 ` Vincenzo Frascino
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=f283de36-b620-03f0-b97b-fd63900e33ce@arm.com \
--to=vincenzo.frascino@arm.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=paul.burton@mips.com \
--cc=pcc@google.com \
--cc=ralf@linux-mips.org \
--cc=salyzyn@android.com \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
/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