mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux@armlinux.org.uk, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com, john.stultz@linaro.org,
	sboyd@codeaurora.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com,
	douly.fnst@cn.fujitsu.com
Subject: Re: [PATCH v6 1/4] sched/clock: interface to allow timestamps early in boot
Date: Wed, 18 Oct 2017 23:01:53 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1710182256260.2477@nanos> (raw)
In-Reply-To: <f731d0ba-2f30-e9b5-5575-767663560265@oracle.com>

On Mon, 9 Oct 2017, Pavel Tatashin wrote:
> > Urgh, that's horrific.
> > 
> > Can't we simply make sched_clock() go earlier? (we're violating "notsc"
> > in any case and really should kill that option).
> > 
> > Then we can do something like so on top...
> > 
> 
> Hi Peter,
> 
> I've been thinking about your proposal, and I have one concern: sched_clock()
> can be implemented two ways either via pv_time_ops.sched_clock vectors when
> CONFIG_PARAVIRT is defined
> 
> sched_clock()
>    paravirt_sched_clock()
>       PVOP_CALL0(unsigned long long, pv_time_ops.sched_clock);
> 
> Or native via alias
> 
> sched_clock()
> 	native_sched_clock()
> 
> Using sched_clock_early() approach makes early time stamps work with both
> cases when it is determined that tsc can be used simple_udelay_calibration().
> (As we agreed I am going to change notsc to use tsc=unstable path.)
> 
> It may be not the most efficient clock for some virtualizations to use rdtsc
> directly, but since this is for early boot only, and not something that is
> going to be used after machine is booted it is OK.

The early boot time stamps are not really important for the production use
case where you care about performance.

So it's simple enough to refactor the code so it supports early time stamps
under the following conditons:

   1) TSC is stable and constant frequency

   2) TSC frequency is known early

   3) paravirt sched clock is not used

      - running on bare metal

      - forcing the paravirt stuff to not override pv_time_ops.sched_clock
        via an command line parameter

That's a valid restriction for the intended use case, i.e. timing of early
boot process.

Thanks,

	tglx

  reply	other threads:[~2017-10-18 21:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 18:03 [PATCH v6 0/4] Early boot time stamps for x86 Pavel Tatashin
2017-08-30 18:03 ` [PATCH v6 1/4] sched/clock: interface to allow timestamps early in boot Pavel Tatashin
2017-09-27 12:58   ` Peter Zijlstra
2017-09-27 13:10     ` Peter Zijlstra
2017-09-27 13:16       ` Pasha Tatashin
2017-09-27 13:52         ` Dou Liyang
2017-09-27 17:13           ` Pasha Tatashin
2017-09-27 18:05           ` Peter Zijlstra
2017-09-27 18:09             ` Peter Zijlstra
2017-09-28 10:03               ` Dou Liyang
2017-09-28 11:58                 ` Peter Zijlstra
2017-09-28 12:12                   ` Thomas Gleixner
2017-09-28 13:11                     ` Pasha Tatashin
2017-09-29 15:00                       ` Dou Liyang
2017-10-18 10:01                         ` Dou Liyang
2017-10-18 13:38                           ` Pavel Tatashin
2017-10-09 16:34     ` Pavel Tatashin
2017-10-18 21:01       ` Thomas Gleixner [this message]
2017-09-27 14:45   ` Russell King - ARM Linux
2017-09-27 17:10     ` Pasha Tatashin
2017-09-27 18:11     ` Peter Zijlstra
2017-08-30 18:03 ` [PATCH v6 2/4] time: sync read_boot_clock64() with persistent clock Pavel Tatashin
2017-08-30 18:03 ` [PATCH v6 3/4] x86/time: read_boot_clock64() implementation Pavel Tatashin
2017-08-30 18:03 ` [PATCH v6 4/4] x86/tsc: use tsc early Pavel Tatashin
     [not found]   ` <CALBSrqBKsojGGpe85GOg7jda-SJHLrR=pS-Pg-xa0SUg7j3OQA@mail.gmail.com>
2017-08-30 21:21     ` Fenghua Yu
2017-08-30 21:32       ` Pasha Tatashin

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.1710182256260.2477@nanos \
    --to=tglx@linutronix.de \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=peterz@infradead.org \
    --cc=sboyd@codeaurora.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=x86@kernel.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 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®