From: Thomas Gleixner <tglx@linutronix.de>
To: "Mirea, Bogdan-Stefan" <Bogdan-Stefan_Mirea@mentor.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"john.stultz@linaro.org" <john.stultz@linaro.org>,
"ore@pengutronix.de" <ore@pengutronix.de>,
"kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: RE: [PATCH v3] Added "Preserve Boot Time Support"
Date: Tue, 23 May 2017 18:39:04 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1705231836040.2740@nanos> (raw)
In-Reply-To: <7927187342d24ae7bc77ba1997e0aa4b@svr-ies-mbx-01.mgc.mentorg.com>
On Tue, 23 May 2017, Mirea, Bogdan-Stefan wrote:
> On Monday, May 22, 2017 12:36 AM, Thomas Gleixner wrote:
> > On Fri, 19 May 2017, Bogdan Mirea wrote:
> > This adds a arch_timer specific command line option. Why is this
> > arch_timer
> > specific? So if any other platform wants to gain this feature then we
> > end
> > up copying that mess to every single timer implementation? Certainly
> > NOT!
> > Exactly nothing. settimeofday() modifies CLOCK_REALTIME and if the
> > platform
> > has an early accessible RTC, you hereby wreckaged wall_time. If the
> > RTC
> > readout comes later then CLOCK_REALTIME is overwritten. So what is
> > this
> > supposed to do?
> >
> > It has absolutely nothing to do with CLOCK_BOOTTIME. /proc/uptime is
> > based
> > on CLOCK_BOOTTIME, which is the CLOCK_MONOTONIC time since system
> > boot. The
> > difference between CLOCK_MONOTONIC and CLOCK_BOOTTIME is that
> > CLOCK_MONOTONIC does not advance during suspend, but CLOCK_BOOTTIME
> > takes
> > the suspended time into account.
> Thanks for feedback.
> The idea of this patch was of a POC and this is why the code was
> isolated in timer driver, which I agree is not a good idea for other
> platforms to copy this since we can simply do all the things in
> sched_clock_register() function guarded with CONFIG_BOOT_TIME_PRESERVE.
> The patch was created for an internal project where no RTC was available
> and no user-space apps were making any settimeofday(), and the use of
> do_settimeofday() seemed safe. But yes, considering that the
> CLOCK_REALTIME can be easily changed it should not be used here.
It does not matter at all whether you have a RTC or settimeofday() is used
or not.
Again:
> > It has absolutely nothing to do with CLOCK_BOOTTIME. /proc/uptime is
> > based on CLOCK_BOOTTIME, which is the CLOCK_MONOTONIC time since system
> > boot. The difference between CLOCK_MONOTONIC and CLOCK_BOOTTIME is that
> > CLOCK_MONOTONIC does not advance during suspend, but CLOCK_BOOTTIME
> > takes the suspended time into account.
So using settimeofday() for any of what you want to do is bogus and
useless.
Thanks,
tglx
next prev parent reply other threads:[~2017-05-23 16:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 10:16 Bogdan Mirea
2017-05-21 21:36 ` Thomas Gleixner
2017-05-23 15:50 ` Mirea, Bogdan-Stefan
2017-05-23 16:39 ` Thomas Gleixner [this message]
2017-05-24 9:35 ` Mirea, Bogdan-Stefan
2017-05-26 10:04 ` Thomas Gleixner
2017-05-30 10:07 ` Mirea, Bogdan-Stefan
2017-05-25 17:05 ` Pavel Machek
2017-05-26 11:09 ` 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=alpine.DEB.2.20.1705231836040.2740@nanos \
--to=tglx@linutronix.de \
--cc=Bogdan-Stefan_Mirea@mentor.com \
--cc=john.stultz@linaro.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ore@pengutronix.de \
/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
all inboxes | Powered by JetHome®