From: Mark Salyzyn <salyzyn@android.com>
To: Mark Rutland <mark.rutland@arm.com>
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>,
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,
Mark Salyzyn <salyzyn@google.com>
Subject: Re: [PATCH v3 05/12] arm: vdso: do calculations outside reader loops
Date: Mon, 30 Oct 2017 13:27:22 -0700 [thread overview]
Message-ID: <040cf1cc-28a0-0f4c-1c08-7bc8a9dc75a2@android.com> (raw)
In-Reply-To: <20171030141517.25ex2os47cyvah2z@lakrids.cambridge.arm.com>
Thanks for the review, am taking all the points into consideration.
On 10/30/2017 07:15 AM, Mark Rutland wrote:
>> +
>> + typeof(((struct vdso_data *)vd)->xtime_clock_sec) sec;
> Why do we need to do this typeof() magic?
>
> Can't we settle on a consistent type across arches, or have a typedef in
> a header?
Would you accept 'because I do not want to standardize the sizes yet'?
[TL;DR]
We could, if there was one, but there isn't currently, and I do not want
to invent one within the context of this series. It is also an
architectural decision to decide on the individual size of
xtime_clock_sec, rate_time_sec and wtm_clock_nsec (or equivalents, not
yet common names throughout), because pedantically they must _all_ be
u64, but realistically they only need to be u32 on the smaller
platforms. This gets even more complicated for compat (vdso32 etc)
implementations as to what is optimal, realistic, desired or pedantic;
and we have not even dealt with that. I'd prefer to be agnostic in that
debate for now and typeof() (which there is precedence to use in the
linux code tree outside of a macro) handily deals with that controversy.
As for tv_sec and tv_nsec, there is precedence to override them in
private product builds or architectures (#define _STRUCT_TIMESPEC) so I
could not count on them being __kernel_time_t or long respectively.
typeof() was used to also allow that flexibility. I am not sure this
happens, only that the levers are there to allow it. typeof() allows me
to respect that facility.
Yes, the code gets much more optimal with the help of typeof() for the
arm architecture if these are all u32 in size. I am wondering out loud
that we may wish to only use u32 in vdso32, despite the size(s) of all
of these structure members. But that is another patch series (on hold
until these are settled).
I am thinking of a nebulous future. The decision for these are being
deferred because my focus is on arm and arm64 because they are testable
with my current resources. On purpose am not unifying all the vdso_data
and vdso.c implementation details as that phase may follow (by me or
others). In that phase xtime_clock_sec, rate_time_sec and wtm_clock_nsec
could very well be standardized and these typeof()'s may melt away. mips
and tile (because they are written in C) could be the next existing
arches that could serve merged into this, but I do not have the
platforms to test the changes on.
-- Mark
next prev parent reply other threads:[~2017-10-30 20:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 22:25 Mark Salyzyn
2017-10-30 14:15 ` Mark Rutland
2017-10-30 20:27 ` Mark Salyzyn [this message]
2017-10-31 10:36 ` Mark Rutland
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=040cf1cc-28a0-0f4c-1c08-7bc8a9dc75a2@android.com \
--to=salyzyn@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=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=salyzyn@google.com \
--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
Powered by JetHome