All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	cpufreq@vger.kernel.org, Linux PM list <linux-pm@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH 1/2] time: allow changing the timekeeper clock frequency
Date: Wed, 14 Aug 2013 11:17:50 -0700	[thread overview]
Message-ID: <CALAqxLX8zkzofgGSdEVsP4wdnejd25iSFHyhBwp7nRVgEnqNrA@mail.gmail.com> (raw)
In-Reply-To: <201308081953.r78Jrt0Z029523@farm-0021.internal.tilera.com>

On Thu, Aug 8, 2013 at 12:34 PM, Chris Metcalf <cmetcalf@tilera.com> wrote:
> On the tile architecture, we use the processor clock tick as the time
> source.  However, when we perform dynamic frequency adjustment and
> modify the clock rate of the core, we have to update the timekeeper
> state to account for the new frequency, as well as for the time it took
> to actually modify the frequency across the chip as a whole.
>
> This change introduces two new functions, timekeeping_chfreq(), which
> changes the frequency, plus timekeeping_chfreq_prep(), used to put the
> timekeeping system in a state that is ready for a frequency change.
> More information is in the comments for the new functions.

So a long while back we had tried to adapt for clock frequency changes
on things like the TSC, but it resulting in *terrible* timekeeping as
the latency between the frequency change and the handling of the
notifications caused lots of clock drift, making it impossible for NTP
or other synchronization methods to work properly. So early on we made
a requirement that all clocksources have a constant frequency and
provided a way to disqualify any clocksources that change frequency.

So I'd be very hesitant to try to add any such behavior into the
timekeeping core. You may want to try to add some logic in the
clocksource driver itself to allow for the variable freq clocksource
to output what seems to be a fixed freq, and if we get some time on it
to prove that it can be made to work well, then we can see about
making it more generic.

Does that sound ok?

thanks
-john

  parent reply	other threads:[~2013-08-14 18:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 19:34 [PATCH 1/2] time: allow changing the timekeeper clock frequency Chris Metcalf
2013-08-08 19:34 ` Chris Metcalf
2013-08-08 19:38 ` [PATCH 2/2] tile: implement dynamic frequency changing Chris Metcalf
2013-08-08 19:38   ` Chris Metcalf
2013-08-09 19:34 ` [PATCH v2 1/2] time: allow changing the timekeeper clock frequency Chris Metcalf
2013-08-09 19:34   ` Chris Metcalf
2013-08-09 19:34   ` [PATCH v2 2/2] tile: implement dynamic frequency changing Chris Metcalf
2013-08-09 19:34     ` Chris Metcalf
2013-08-14 18:17 ` John Stultz [this message]
2013-08-14 21:30   ` [PATCH 1/2] time: allow changing the timekeeper clock frequency Chris Metcalf
2013-08-14 21:30     ` Chris Metcalf
2013-08-29 18:40     ` Chris Metcalf
2013-08-29 18:40       ` Chris Metcalf
2013-08-29 19:30       ` John Stultz
2013-08-30 14:40         ` Chris Metcalf
2013-08-30 14:40           ` Chris Metcalf
2013-08-30 16:04           ` John Stultz

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=CALAqxLX8zkzofgGSdEVsP4wdnejd25iSFHyhBwp7nRVgEnqNrA@mail.gmail.com \
    --to=john.stultz@linaro.org \
    --cc=cmetcalf@tilera.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.