From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Petr Mladek <pmladek@suse.com>,
Mark Rutland <mark.rutland@arm.com>,
Pavel Tatashin <pasha.tatashin@soleen.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/3] printk: Allow architecture-specific timestamping function
Date: Mon, 22 Jul 2019 14:03:11 +0100 [thread overview]
Message-ID: <20190722130311.GD1330@shell.armlinux.org.uk> (raw)
In-Reply-To: <493e2c0b-9536-ce6d-b59e-d169693085da@arm.com>
On Mon, Jul 22, 2019 at 01:47:57PM +0100, Marc Zyngier wrote:
> On 22/07/2019 12:25, Petr Mladek wrote:
> > On Mon 2019-07-22 11:33:28, Marc Zyngier wrote:
> >> printk currently relies on local_clock to time-stamp the kernel
> >> messages. In order to allow the timestamping (and only that)
> >> to be overridden by architecture-specific code, let's declare
> >> a new timestamp_clock() function, which gets used by the printk
> >> code. Architectures willing to make use of this facility will
> >> have to define CONFIG_ARCH_HAS_TIMESTAMP_CLOCK.
> >>
> >> The default is of course to return local_clock(), so that the
> >> existing behaviour stays unchanged.
> >>
> >> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> >> ---
> >> include/linux/sched/clock.h | 13 +++++++++++++
> >> kernel/printk/printk.c | 4 ++--
> >> 2 files changed, 15 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/include/linux/sched/clock.h b/include/linux/sched/clock.h
> >> index 867d588314e0..3cf4b2a8ce18 100644
> >> --- a/include/linux/sched/clock.h
> >> +++ b/include/linux/sched/clock.h
> >> @@ -98,4 +98,17 @@ static inline void enable_sched_clock_irqtime(void) {}
> >> static inline void disable_sched_clock_irqtime(void) {}
> >> #endif
> >>
> >> +#ifdef CONFIG_ARCH_HAS_TIMESTAMP_CLOCK
> >> +/* Special need architectures can provide their timestamping function */
> >
> > The commit message and the above comment should be more specific
> > about what are the special needs.
> >
> > It must be clear how and why the clock differs from the other
> > clocks, especially from lock_clock().
>
> Fair enough. How about something along the lines of:
>
> "An architecture can override the timestamp clock (which defaults to
> local_clock) if local_clock is not significant early enough (sched_clock
> being available too late)."
We have:
1) the standard clocksource
2) the sched_clock, which is _supposed_ to be initialised early
3) persistent_clock
Do we really need another clock?
Why not initialise sched_clock() early (as in, before sched_init(),
which is where the first sched_clock() read occurs) ?
We've already been around the argument that sched_clock() apparently
can't be initialised early enough (which is the argument I had in reply
to the sched_clock() situation on ARM32) then how does inventing
timestamp_clock() solve this problem?
Wouldn't timestamp_clock() also suffer from the very same "we can't
initialise it early enough" issue, and it'll just be setup along side
clocksources, just like sched_clock() has become?
I fail to see what adding yet another architecture specific clock
implementation buys, apart from yet more complexity.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
next prev parent reply other threads:[~2019-07-22 13:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 10:33 [PATCH 0/3] arm64: Allow early timestamping of kernel log Marc Zyngier
2019-07-22 10:33 ` [PATCH 1/3] printk: Allow architecture-specific timestamping function Marc Zyngier
2019-07-22 11:25 ` Petr Mladek
2019-07-22 12:47 ` Marc Zyngier
2019-07-22 13:03 ` Russell King - ARM Linux admin [this message]
2019-07-22 13:26 ` Marc Zyngier
2019-07-22 10:33 ` [PATCH 2/3] sched/clock: Allow sched_clock to inherit timestamp_clock epoch Marc Zyngier
2019-07-22 10:33 ` [PATCH 3/3] arm64: Allow early time stamping Marc Zyngier
2019-07-22 20:52 ` [PATCH 0/3] arm64: Allow early timestamping of kernel log Pavel Tatashin
2019-07-23 7:17 ` Marc Zyngier
2019-09-23 19:13 ` Pavel Tatashin
2019-07-23 2:42 ` Hanjun Guo
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=20190722130311.GD1330@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=catalin.marinas@arm.com \
--cc=john.stultz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=pasha.tatashin@soleen.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tglx@linutronix.de \
--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