linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Florian Weimer <fweimer@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Theodore Ts'o" <tytso@mit.edu>, "H. Peter Anvin" <hpa@zytor.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Karel Zak <kzak@redhat.com>,
	Lennart Poettering <lennart@poettering.net>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Subject: Re: New kernel interface for sys_tz and timewarp?
Date: Tue, 13 Aug 2019 10:10:53 -0700	[thread overview]
Message-ID: <CALAqxLUde4OTEm3Kik0Fvydhp+i-Xo-axS2wRKEBJyT9hY=wCg@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a0VxM1BkjY1D2FfHi6L-ho_NH3v3+gBu45EfpjLF5NU5w@mail.gmail.com>

On Tue, Aug 13, 2019 at 2:06 AM Arnd Bergmann <arnd@arndb.de> wrote:
> Now, to the actual questions:
>
> * Should we allow setting the sys_tz on new architectures that use only
>   time64 interfaces at all, or should we try to get away from that anyway?

So I'd probably cut this question a bit differently:

1) Do we want to deprecate sys_tz tracking in the kernel? If new
architectures don't have ways to set it, for consistency we should
probably deprecate in-kernel tracking of that value (start returning
an error when folks try to set it and always return 0 when its
accessed).

2) If we deprecate the sys_tz tracking in the kernel, how do we
address the in-kernel systohc syncing with local-time (non-UTC) RTCs
on x86 systems (I'm not aware of other arches that utilize non-UTC
RTCs)


> * Should the NTP timewarp setting ("int persistent_clock_is_local" and
>   its offset) be controllable separately from the timezone used in other
>   drivers?

For the discussion, I'm not sure I'd call this NTP timewarp, but maybe
systohc rtc offset is more clear?

Its really not connected to NTP, except that we only want to
automatically sync the RTC to the system clock when we know the system
clock is right (and that signal comes from NTP).


> * If we want keep having a way to set the sys_tz, what interface
> should that use?
>
>   Suggestions so far include
>    - adding a clock_settimeofday_time64() syscall on all 32-bit architectures to
>      maintain the traditional behavior,

If the answer to #1 above is no, we want to preserve the
functionality, then I think this is probably the best solution.
Alternatively one could add a new syscall/sysctrl that just sets the
timezone, but most 64 bit architectures already have
clock_settimeofday_time64() equiv call, so this is probably the least
duplicative.

>    - adding a sysctl interface for accessing sys_tz.tz_tminuteswest,
>    - using a new field in 'struct timex' for the timewarp offset, and

I'd push back on this one. The timewarp offset is really a RTC offset,
and has nothing to do with ntp, so we shoudn't be adding things to
adjtimex about it.

>    - adding an ioctl command on /dev/rtc/ to control the timewarp
>      offset of that particular device.

If the answer to #1 above is yes, then I think this makes more sense
to me, since the offset is a property of how we interpret the RTC (ie:
is it UTC or local time).

Getting more aggressive, from irc discussions, it sounded like
Alexandre would like to deprecate the in-kernel systohc and hctosys
logic, so if that were the case, and the answer to #1 above was yes,
then we could probably skip all of this and just drop systohc work and
keep the UTC/local logic to userland.

thanks
-john

  reply	other threads:[~2019-08-13 17:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  9:05 New kernel interface for sys_tz and timewarp? Arnd Bergmann
2019-08-13 17:10 ` John Stultz [this message]
2019-08-13 21:45   ` Alexandre Belloni
2019-08-13 17:30 ` Linus Torvalds
2019-08-13 17:49   ` Paul Eggert
2019-08-13 19:31     ` Florian Weimer
2019-08-13 20:04       ` Arnd Bergmann
2019-08-13 21:56   ` Alexandre Belloni
2019-08-14  0:06   ` Theodore Y. Ts'o
2019-08-14  8:31     ` Arnd Bergmann
2019-08-14  9:09       ` Lennart Poettering
2019-08-14  9:32         ` Alexandre Belloni
2019-08-14 12:15           ` Lennart Poettering
2019-08-19 11:09           ` Karel Zak
2019-08-19 13:43             ` Thomas Gleixner
2019-08-19 13:49               ` Thomas Gleixner
2019-08-20 18:45                 ` Alexandre Belloni
2019-08-20 18:47               ` Alexandre Belloni
2019-08-20 18:58             ` Alexandre Belloni
2019-08-27 16:27               ` Arnd Bergmann
2019-08-27 16:31                 ` Alexandre Belloni
2019-08-14 16:26     ` David Laight
2019-08-14 16:47       ` hpa
2019-08-15 13:22         ` Arnd Bergmann
2019-08-15 15:05           ` Theodore Y. Ts'o
2019-08-15 15:24             ` hpa

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='CALAqxLUde4OTEm3Kik0Fvydhp+i-Xo-axS2wRKEBJyT9hY=wCg@mail.gmail.com' \
    --to=john.stultz@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alistair.francis@wdc.com \
    --cc=arnd@arndb.de \
    --cc=fweimer@redhat.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=hpa@zytor.com \
    --cc=kzak@redhat.com \
    --cc=lennart@poettering.net \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /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).