linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Petr Mladek <pmladek@suse.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Prarit Bhargava <prarit@redhat.com>,
	Dave Young <dyoung@redhat.com>, Baoquan He <bhe@redhat.com>,
	Vivek Goyal <vgoyal@redhat.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Stultz <john.stultz@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	kexec@lists.infradead.org
Subject: [patch 0/2] timekeeping: NMI safe timekeeper enhancements
Date: Fri, 14 Aug 2020 12:19:33 +0200	[thread overview]
Message-ID: <20200814101933.574326079@linutronix.de> (raw)

printk intends to store various timestamps (MONOTONIC, REALTIME, BOOTTIME)
to make correlation of dmesg accross different machines easier.

The NMI safe timekeeper allows to retrieve these timestamps from any
context, but it lacks a few things:

  1) The nmi safe accessors are not providing time stamps until timekeeping
     is initialized during early boot.

     This can be mitigated by using sched clock up to the point where time-
     keeping becomes available. This has no side effects because clock
     monotonic takes sched clock into account at initialization time
     anyway. So no random time jumps are possible.

     If early sched clock is not available then there is no difference
     either, obviously. Both return 0.

  2) It requires a new accessor which allows to retrieve all three clock
     timestamps in one go.

     Trivial excercise. But there are a few twists:

     A) Access to boot time can be racy if the sleep time offset on resume
     	is injected after timekeeping resume. That's the case when the RTC
     	or whatever is used to calculate sleep time is not availble when
	the timekeeping core is resumed.

     B) Timestamps are frozen accross the very inner low level
     	suspend/resume path. Not a big problem, but might affect the
     	developer debug printks.

     A detailed description of these two points is in the changelog of
     patch 2.

Thanks,

	tglx

             reply	other threads:[~2020-08-14 11:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 10:19 Thomas Gleixner [this message]
2020-08-14 10:19 ` [patch 1/2] timekeeping: Utilize local_clock() for NMI safe timekeeper during early boot Thomas Gleixner
2020-08-23  8:40   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-08-14 10:19 ` [patch 2/2] timekeeping: Provide multi-timestamp accessor to NMI safe timekeeper Thomas Gleixner
2020-08-23  8:40   ` [tip: timers/core] " tip-bot2 for Thomas Gleixner
2020-08-20  8:47 ` [patch 0/2] timekeeping: NMI safe timekeeper enhancements Petr Mladek
2020-08-20 10:30   ` Thomas Gleixner
2020-08-20 10:43     ` Petr Mladek
2020-08-23  8:43       ` Thomas Gleixner

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=20200814101933.574326079@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=bhe@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sboyd@kernel.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=vgoyal@redhat.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).