linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vincenzo.frascino@arm.com (Vincenzo Frascino)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/27] Unify vDSOs across more architectures
Date: Fri, 23 Nov 2018 11:05:08 +0000	[thread overview]
Message-ID: <5c52c92c-2bbc-1d8e-faea-2117ecebfd72@arm.com> (raw)
In-Reply-To: <CAK8P3a1obPxkJROk5rN7OpL3AE-3Yifu-vUqepUUz+yO_HNd7g@mail.gmail.com>

On 11/10/18 4:33 PM, Arnd Bergmann wrote:
> On 11/9/18, Vincenzo Frascino <vincenzo.frascino@arm.com> wrote:
>> vDSO (virtual dynamic shared object) is a mechanism that the Linux
>> kernel provides as an alternative to system calls to reduce where
>> possible the costs in terms of cycles.
>> This is possible because certain syscalls like gettimeofday() do
>> not write any data and return one or more values that are stored
>> in the kernel, which makes relatively safe calling them directly
>> as a library function.
>>
>> Even if the mechanism is pretty much standard, every architecture
>> in the last few years ended up implementing their own vDSO library
>> in the architectural code.
>>
>> The purpose of this patch-set is to identify the commonalities in
>> between the architectures and try to consolidate the common code
>> paths, starting with gettimeofday().
> 
> I'm very happy to see the generalization overall, as this is going
> to make it much easier to add the 64-bit time_t on the 32-bit
> vdso implementations, as well as other extensions we may want
> in the future.
> 

Thanks,

>> This implementation contains the following design choices:
>>  * Every architecture defines the arch specific code in an header in
>>    "asm/vdso/".
>>  * The generic implementation includes the arch specific one and lives
>>    in "lib/vdso".
> 
> Makes sense.
> 
>>  * The arch specific code for gettimeofday lives in
>>    "<arch path>/vdso/gettimeofday.c" and includes the generic code only.
>>  * This approach allows to consolidate the common code in a single place
>>    with the benefit of avoiding code duplication.
> 
> I would prefer to have that named clock_gettime.c and only implement
> that one system call there. We can easily have the gettimeofday(),
> time() and clock_getres() in the common code where that is needed
> for backwards compatibility. As I already mentioned in my comment
> for one of the patches, we won't have time() or gettimeofday() system
> calls on new architectures, and 32-bit architectures won't have them
> with 64-bit time_t.
> 

The reason why I used gettimeofday.c as a filename is because it is the naming
convention that I could see more often in the kernel and I feel that, if we have
even the implementations of gettimeofday(), time() and clock_getres() in the
same file is probably the most representative.

> I suppose we can have the time() and gettimeofday() calls
> implemented in the generic vdso for everyone, but then
> only hook those up on architectures that already had
> them. The implementation of course is trivial based on
> clock_gettime() with CLOCK_REALTIME or CLOCK_REALTIME_COARSE
> respectively.
> 

I agree, and in the long term would be my preferred approach as well, but I
would prefer to keep this "optimization" in a separate patchset for what I
mentioned in my previous email.

>> This implementation contains the portings to the common library for: arm64,
>> compat mode for arm64, arm and mips.
>>
>> The mips porting has been tested on qemu for mips32el. A configuration to
>> repeat the tests can be found at [4].
> 
> Ah, I missed the fact that you didn't do this for x86, so I assumed that
> this work was triggered by Thomas' recent cleanup of the x86 clock_gettime
> vdso code. I think it would be best to get x86 to use the same code and
> get the recent improvements ported to the others as well that way.
>

Yes, I agree it would be great to have have the other architectures to join the
effort because I believe that the whole ecosystem would benefit from it.

>       Arnd
> 

-- 
Regards,
Vincenzo

      reply	other threads:[~2018-11-23 11:05 UTC|newest]

Thread overview: 48+ 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 ` [PATCH 01/27] kernel: Standardize vdso_datapage Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 02/27] kernel: Add Monotonic boot time support Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 03/27] kernel: Add International Atomic Time support 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 ` [PATCH 05/27] kernel: Add clock_mode support Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 06/27] kernel: Define gettimeofday vdso common code Vincenzo Frascino
2018-11-09 16:05   ` Arnd Bergmann
2018-11-13 10:21     ` Vincenzo Frascino
2018-11-10 16:18   ` Arnd Bergmann
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 16:13   ` Arnd Bergmann
2018-11-09 17:23     ` Mark Salyzyn
2018-11-09 21:13       ` Arnd Bergmann
2018-11-13 10:58     ` Vincenzo Frascino
2018-11-14 17:47       ` Arnd Bergmann
2018-11-23 10:49         ` Vincenzo Frascino
2018-11-23 11:14           ` Arnd Bergmann
2018-11-09 18:09   ` Peter Collingbourne
2018-11-13 10:36     ` Vincenzo Frascino
2018-11-10  0:29   ` David Miller
2018-11-12 18:21     ` Mark Salyzyn
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 ` [PATCH 09/27] arm64: compat: Split kuser32 Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 10/27] arm64: compat: Refactor aarch32_alloc_vdso_pages() Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 11/27] arm64: compat: Add KUSER_HELPERS config option Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 12/27] arm64: compat: Add missing syscall numbers Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 13/27] arm64: compat: Expose signal related structures Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 14/27] arm64: compat: Generate asm offsets for signals Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 15/27] lib: vdso: Add compat support Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 16/27] arm64: compat: Add vDSO Vincenzo Frascino
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 ` [PATCH 18/27] arm64: compat: vDSO setup for compat layer Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 19/27] arm64: elf: vDSO code page discovery Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 20/27] arm64: compat: Get sigreturn trampolines from vDSO Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 21/27] arm64: Add vDSO compat support Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 22/27] arm64: Enable compat vDSO support Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 23/27] arm: Add support for generic vDSO Vincenzo Frascino
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 ` [PATCH 25/27] clock: csrc-4k: Add support for vdso_direct Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 26/27] clock: gic-timer: " Vincenzo Frascino
2018-11-09 12:37 ` [PATCH 27/27] mips: Add support for generic vDSO Vincenzo Frascino
2018-11-10 16:33 ` [PATCH 00/27] Unify vDSOs across more architectures Arnd Bergmann
2018-11-23 11:05   ` Vincenzo Frascino [this message]

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=5c52c92c-2bbc-1d8e-faea-2117ecebfd72@arm.com \
    --to=vincenzo.frascino@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).