linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Salyzyn <salyzyn@android.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>,
	Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Dmitry Safonov <dsafonov@virtuozzo.com>,
	John Stultz <john.stultz@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Laura Abbott <labbott@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Andy Gross <andy.gross@linaro.org>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	Andrew Pinski <apinski@cavium.com>,
	linux-arm-kernel@lists.infradead.org,
	Jeremy Linton <Jeremy.Linton@arm.com>,
	android-kernel@android.com, Jinbum Park <jinb.park7@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: RESEND [PATCH v6 11/12] lib: vdso: Add support for CLOCK_BOOTTIME
Date: Mon, 1 Oct 2018 13:52:32 -0700	[thread overview]
Message-ID: <a602b661-dde5-399d-6245-cf48a0e43f54@android.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1810012009010.32062@nanos.tec.linutronix.de>

On 10/01/2018 11:15 AM, Thomas Gleixner wrote:
> On Mon, 1 Oct 2018, Mark Salyzyn wrote:
>>   
>> +static notrace int do_boottime(const struct vdso_data *vd, struct timespec *ts)
>> +{
>> +	u32 seq, mult, shift;
>> +	u64 nsec, cycle_last;
>> +	vdso_wtm_clock_nsec_t wtm_nsec;
>> +
>> +	/* open coding timespec_add_ns to save a ts->tv_nsec = 0 */
>> +	ts->tv_sec = sec + __iter_div_u64_rem(nsec, NSEC_PER_SEC, &nsec);
>> +	ts->tv_nsec = nsec;
>> +
>> +	return 0;
>> +}
>> +
> Instead of adding yet another copy of the same code you might want to look
> at the rework I did for the x86 vdso in order to support CLOCK_TAI w/o
> running into the issue of the clock switch case being compiled into a jump
> table and then the compile asking for retpoline.
>
>    http://lkml.kernel.org/r/20180917124533.329334911@linutronix.de
>
> Thanks,
>
> 	tglx

Great idea. Thanks!

The point of the first 12 patches is to _align_ the arm code to match 
the assembler for arm64 exactly 1:1. Then switch arm64 assembler to use 
the _same_ code in 'C' as a library. No performance degradation.

Next extend the vdso framework on arm64 to _also_ use that library for 
vDSO32 (arm32 compat on 64-bit). At this point we achieve a 0.4% power 
reduction on Android.

At that point, we would be ready for a rework that fixes all three (ARM 
vDSO, ARM64 vDSO and ARM64 vDSO32) to get the compiler to handle the 
switch statement better. One step at a time.

-- Mark



  reply	other threads:[~2018-10-01 20:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 17:58 RESEND and REBASE arm+arm64+aarch32 vdso rewrite Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 01/12] arm: vdso: rename vdso_datapage variables Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 02/12] arm: vdso: add include file defining __get_datapage() Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 03/12] arm: vdso: inline assembler operations to compiler.h Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 04/12] arm: vdso: do calculations outside reader loops Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC_RAW Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 06/12] arm: vdso: add support for clock_getres Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 07/12] arm: vdso: disable profiling Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/ Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with global vgettimeofday.C Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v6 11/12] lib: vdso: Add support for CLOCK_BOOTTIME Mark Salyzyn
2018-10-01 18:15   ` Thomas Gleixner
2018-10-01 20:52     ` Mark Salyzyn [this message]
2018-10-01 17:58 ` RESEND [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if no arch supported timer Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH] lib: vdso: add support for time Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v3 1/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (C sources) Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v3 2/3] arm64: compat: Split the sigreturn trampolines and kuser helpers (assembler sources) Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v3 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH] arm64: compat: Expose offset to registers in sigframes Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines if available Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat processes Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 3/6] arm64: Refactor vDSO init/setup Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v2 4/6] arm64: compat: Add a 32-bit vDSO Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH 5/6] arm64: compat: 32-bit vDSO setup Mark Salyzyn
2018-10-01 17:58 ` RESEND [PATCH v2 6/6] arm64: Wire up and expose the new compat vDSO Mark Salyzyn
2018-10-01 18:49 ` RESEND and REBASE arm+arm64+aarch32 vdso rewrite John Stultz
2018-10-01 20:44   ` Mark Salyzyn
2018-10-01 21:28     ` John Stultz
2018-10-02  8:50     ` Russell King - ARM Linux
2018-10-02 14:53       ` Mark Salyzyn
2018-10-02 10:00     ` Catalin Marinas
2018-10-02 15:09       ` Mark Salyzyn
  -- strict thread matches above, loose matches on Subject: below --
2018-06-18 15:05 RESEND " Mark Salyzyn
2018-06-18 15:05 ` RESEND [PATCH v6 11/12] lib: vdso: Add support for CLOCK_BOOTTIME Mark Salyzyn

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=a602b661-dde5-399d-6245-cf48a0e43f54@android.com \
    --to=salyzyn@android.com \
    --cc=Jeremy.Linton@arm.com \
    --cc=android-kernel@android.com \
    --cc=andy.gross@linaro.org \
    --cc=apinski@cavium.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=dsafonov@virtuozzo.com \
    --cc=james.morse@arm.com \
    --cc=jinb.park7@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=keescook@chromium.org \
    --cc=kevin.brodsky@arm.com \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luto@amacapital.net \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).