All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linuxfoundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Stultz <john.stultz@linaro.org>,
	Petr Mladek <pmladek@suse.com>,
	Mark Salyzyn <salyzyn@android.com>,
	Prarit Bhargava <prarit@redhat.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Kevin Easton <kevin@guarana.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>
Subject: [RFC/RFT patch 0/7] timekeeping: Unify clock MONOTONIC and clock BOOTTIME
Date: Thu, 01 Mar 2018 17:33:31 +0100	[thread overview]
Message-ID: <20180301163331.987775783@linutronix.de> (raw)

While working through the melted spectrum induced backlog I found that last
years discussion about unifying clock MONOTONIC and clock BOOTTIME has died
out and obviously nobody had time to do testing on that half baken RFC patch:

  https://lkml.kernel.org/r/alpine.DEB.2.20.1711180123360.2186@nanos

So I sat down and revisited it a bit more carefully than last time. The
following series is the result of this work. The main differences are:

 1) Provide CLOCK_MONOTONIC_ACTIVE which has the current CLOCK_MONOTONIC
    behaviour, i.e. it's monotonic time since boot minus the time spent in
    suspend.

    The reason why I introduced it is that currently it's possible for user
    space to determine the time spent in suspend by subtracting clock
    monotonic and clock boot time time stamps. When CLOCK_MONOTONIC behaves
    like CLOCK_BOOTTIME then this is not longer possible.

    As a side effect when CLOCK_MONOTONIC_ACTIVE is supported by a kernel
    then this is also an indicator that CLOCK_MONOTONIC and CLOCK_BOOTTIME
    are identical. So it's possible to determine this w/o playing games
    with kernel versions etc. Older kernels simply return -EiNVAL if
    CLOCK_MONOTONIC_ACTIVE is requested in clock_gettime().

 2) Fixed a few places which I missed last time, which means also that my
    warning in the original changelog was justified.

 3) Consolidated the core users to get rid of the seperate implementations
    for the two clocks

Note, there are user space visible side effects. The difference between
CLOCK_MONOTONIC and CLOCK_BOOTTIME is well documented and it's unclear
whether applications rely on it or not.

This really needs lot of testing, documentation updates and more input from
userspace folks to make a final decision.

Thanks,

	tglx

---

 Documentation/trace/ftrace.txt      |   14 +-----
 drivers/input/evdev.c               |    7 ---
 include/linux/hrtimer.h             |    2 
 include/linux/timekeeper_internal.h |    2 
 include/linux/timekeeping.h         |   37 +++++------------
 include/uapi/linux/time.h           |    1 
 kernel/time/hrtimer.c               |   16 -------
 kernel/time/posix-stubs.c           |    2 
 kernel/time/posix-timers.c          |   26 ++++--------
 kernel/time/tick-common.c           |   15 ++++++
 kernel/time/tick-internal.h         |    6 ++
 kernel/time/tick-sched.c            |    9 ++++
 kernel/time/timekeeping.c           |   78 ++++++++++++++++++------------------
 kernel/time/timekeeping.h           |    1 
 kernel/trace/trace.c                |    2 
 15 files changed, 104 insertions(+), 114 deletions(-)

             reply	other threads:[~2018-03-01 16:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 16:33 Thomas Gleixner [this message]
2018-03-01 16:33 ` [RFC/RFT patch 1/7] timekeeping: Provide CLOCK_MONOTONIC_ACTIVE Thomas Gleixner
2018-03-13  7:06   ` [tip:timers/core] timekeeping: Add the new CLOCK_MONOTONIC_ACTIVE clock tip-bot for Thomas Gleixner
2018-03-01 16:33 ` [RFC/RFT patch 2/7] timekeeping: Make clock MONOTONIC behave like clock BOOTTIME Thomas Gleixner
2018-03-13  7:07   ` [tip:timers/core] timekeeping: Make the MONOTONIC clock behave like the BOOTTIME clock tip-bot for Thomas Gleixner
2018-03-01 16:33 ` [RFC/RFT patch 3/7] Input: evdev - Conflate clock MONOTONIC and BOOTTIME Thomas Gleixner
2018-03-13  7:07   ` [tip:timers/core] Input: Evdev - unify MONOTONIC and BOOTTIME clock behavior tip-bot for Thomas Gleixner
2018-03-01 16:33 ` [RFC/RFT patch 4/7] timekeeping: Remove boot time specific code Thomas Gleixner
2018-03-13  7:08   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2018-03-01 16:33 ` [RFC/RFT patch 5/7] posix-timers: Conflate clock MONOTONIC and BOOTTIME Thomas Gleixner
2018-03-13  7:08   ` [tip:timers/core] posix-timers: Unify MONOTONIC and BOOTTIME clock behavior tip-bot for Thomas Gleixner
2018-03-01 16:33 ` [RFC/RFT patch 6/7] hrtimer: Conflate clock MONOTONIC and BOOTTIME Thomas Gleixner
2018-03-13  7:09   ` [tip:timers/core] hrtimer: Unify MONOTONIC and BOOTTIME clock behavior tip-bot for Thomas Gleixner
2018-03-01 16:33 ` [RFC/RFT patch 7/7] tracing: Conflate boot and monotonic clock Thomas Gleixner
2018-03-13  7:09   ` [tip:timers/core] tracing: Unify the "boot" and "mono" tracing clocks tip-bot for Thomas Gleixner
2018-03-01 17:23 ` [RFC/RFT patch 0/7] timekeeping: Unify clock MONOTONIC and clock BOOTTIME Linus Torvalds
2018-03-01 18:41   ` Thomas Gleixner
2018-03-01 18:50     ` Steven Rostedt
2018-03-01 19:10     ` Thomas Gleixner
2018-03-13  6:36   ` Ingo Molnar
2018-03-13 18:11     ` John Stultz
2018-04-20  4:37       ` David Herrmann
2018-04-20  5:44         ` Sergey Senozhatsky
2018-04-20  6:49           ` David Herrmann
2018-04-24  0:40             ` Genki Sky
2018-04-24  2:45               ` Genki Sky
2018-04-24  3:03                 ` John Stultz
2018-04-24  8:09                   ` Thomas Gleixner
2018-04-24 12:11                     ` Genki Sky
2018-04-24 15:00                       ` Thomas Gleixner
2018-04-25  6:50                     ` Pavel Machek
2018-04-25  8:55                       ` Rafael J. Wysocki
2018-04-25  8:52                     ` Rafael J. Wysocki
2018-04-25  9:49                       ` Rafael J. Wysocki
2018-04-25 13:03                         ` Thomas Gleixner
2018-04-26  7:03                           ` Mike Galbraith
2018-04-26  7:42                             ` Thomas Gleixner
2018-04-26  8:36                               ` Rafael J. Wysocki
2018-04-26  8:51                                 ` Thomas Gleixner
2018-04-26  9:03                                   ` Rafael J. Wysocki

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=20180301163331.987775783@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=corbet@lwn.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=kevin@guarana.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=salyzyn@android.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=torvalds@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.