From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Petr Mladek <pmladek@suse.com>, Ingo Molnar <mingo@kernel.org>,
"H . Peter Anvin" <hpa@zytor.com>,
Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, alek.du@intel.com,
len.brown@intel.com, feng.tang@intel.com
Subject: Re: [RFC 1/2] printk: Enable platform to provide a early boot clock
Date: Thu, 14 Jun 2018 17:55:48 +0800 [thread overview]
Message-ID: <20180614095548.5lbnpm3db2bu2gov@shbuild888> (raw)
In-Reply-To: <alpine.DEB.2.21.1806141107260.1581@nanos.tec.linutronix.de>
Hi Thomas,
On Thu, Jun 14, 2018 at 11:08:04AM +0200, Thomas Gleixner wrote:
> On Thu, 14 Jun 2018, Feng Tang wrote:
> > On Wed, May 30, 2018 at 05:20:58PM +0800, Feng Tang wrote:
> > > Currently printk timestamp mostly come from the sched_clock which
> > > depends on the clock setup, so there are many kernel logs started
> > > with "[ 0.000000] " before the clock is calibrated.
> > >
> > > This patch will provide an debug option for specific platform to
> > > provide a early boot time clock, so that we can have time info in
> > > kernel log much earlier, which can show the time info for the early
> > > kernel boot, and make boottime tuning/optimization easier (boot time
> > > is critical for phone/tablet and embedded devices).
> > >
> > > Capable platform only need to setup the "boot_printk_clock_fn"
> > > which could return time in nano seconds.
> > >
> > > Together with a TSC patch on x86 system, we have easily captured
> > > some early boottime killer like unwind_init() which takes about
> > > 300ms in boot phase.
> >
> > Hi Petr and all,
> >
> > As the 2/2 tsc related patch is still under review/discussion, can
> > we consider taking this first? As this may benefit other archs.
> > For example, Intel Curie platform has an always-on 32KHz osc clock,
> > which is accurate but low frequency, and it could be used as
> > early printk timestamp until the high-resolution timer is initialized
> > and used as sched_clock. Don't know if ARM or other platforms
> > have similar use case.
>
> Can we please _NOT_ add half sorted core stuff in a hurry?
Got it.
The status for the 2/2 tsc patch is Peter suggested to bring the tsc_init()
earlier, with that this 1/2 is not needed for x86. I followed Peter's
suggestion and worked out a hack version with which the tsc inits fine
and printk timestamp works much earlier (detail is in the 2/2 thread).
But there is one blocker, the native_sched_clock()(tsc.c) use one staic key
__use_tsc and sched_clock_cpu()(clock.c) use another "__sched_clock_stable",
which cannot be used so early, one problem is the static_branch_enable()
will use pageing related code while the paging is not setup ready yet.
I haven't got idea to solve this first problem regarding static key.
Thanks,
Feng
prev parent reply other threads:[~2018-06-14 9:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 9:20 Feng Tang
2018-05-30 9:20 ` [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp Feng Tang
2018-05-30 13:25 ` Andy Shevchenko
2018-05-30 14:17 ` Feng Tang
2018-05-31 13:55 ` Petr Mladek
2018-05-31 15:52 ` Peter Zijlstra
2018-06-01 16:12 ` Feng Tang
2018-06-06 9:38 ` Feng Tang
2018-06-06 15:25 ` Pavel Tatashin
2018-06-07 1:34 ` Feng Tang
2018-06-13 7:29 ` Feng Tang
2018-06-01 18:05 ` Pavel Tatashin
2018-05-31 7:18 ` [RFC 1/2] printk: Enable platform to provide a early boot clock Andy Shevchenko
2018-05-31 17:22 ` Randy Dunlap
2018-05-31 18:15 ` Andy Shevchenko
2018-06-14 8:38 ` Feng Tang
2018-06-14 9:08 ` Thomas Gleixner
2018-06-14 9:55 ` Feng Tang [this message]
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=20180614095548.5lbnpm3db2bu2gov@shbuild888 \
--to=feng.tang@intel.com \
--cc=alek.du@intel.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=tglx@linutronix.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®