All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: John Stultz <john.stultz@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Eric Dumazet <dada1@cosmosbay.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [RFC patch 7/8] timekeeping: Implement a shadow timekeeper
Date: Tue, 26 Feb 2013 13:17:07 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.02.1302261316060.22263@ionos> (raw)
In-Reply-To: <512804E9.1010408@linaro.org>

On Fri, 22 Feb 2013, John Stultz wrote:

> On 02/21/2013 02:51 PM, Thomas Gleixner wrote:
> > Use the shadow timekeeper to do the update_wall_time() adjustments and
> > then copy it over to the real timekeeper.
> > 
> > Keep the shadow timekeeper in sync when updating stuff outside of
> > update_wall_time().
> > 
> > This allows us to limit the timekeeper_seq hold time to the update of
> > the real timekeeper and the vsyscall data in the next patch.
> > 
> > Signed-off-by: Thomas Gleixner<tglx@linutronix.de>
> > ---
> 
> So up to here it all looks ok to me (and not so different from my earlier
> attempts at the same).
> 
> The only gotcha here that I realized with my earlier patches, is that in order
> to do the shadow copy update properly, we are also going to need to merge the
> NTP state data into the timekeeper. Otherwise, we could run into odd cases
> where as we update the shadow copy, we change the NTP state which then would
> affect the non-shadow timekeeping state that is about to be updated. One
> example: A the leap second lands, and the tai offset gets bumped in the ntp
> state, while we do a similar counter adjustment to the shadow-copy. Then
> before the real/active timekeeper is updated, someone gets the tai offset and
> applies it to that pre-update timekeeper state, and gets an invalid tai time.
> 
> The down side is that the NTP state data is fairly large, and so adding it to
> the timekeeper will cause the memcopys to be a bit more painful.
> 
> I'm looking at the NTP code now to try to see if we can bound where the NTP
> state is accessed, so we can maybe thin out what ntp state is linked to
> timekeeper updates, and only move that data over to the timekeeper.

Hmm. Can we block the NTP data readout while we are doing the update ?

Thanks,

	tglx

  reply	other threads:[~2013-02-26 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21 22:51 [RFC patch 0/8] timekeeping: Implement shadow timekeeper to shorten in kernel reader side blocking Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 2/8] timekeeping: Make jiffies_lock internal Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 1/8] timekeeping: Calc stuff once Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 3/8] timekeeping: Move lock out of timekeeper struct Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 5/8] timekeeping: Store cycle_last value in timekeeper struct as well Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 4/8] timekeeping: Split timekeeper_lock into lock and seqcount Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 6/8] timekeeping: Delay update of clock->cycle_last Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 8/8] timekeeping: Shorten seq_count region Thomas Gleixner
2013-02-21 22:51 ` [RFC patch 7/8] timekeeping: Implement a shadow timekeeper Thomas Gleixner
2013-02-22 23:53   ` John Stultz
2013-02-26 12:17     ` Thomas Gleixner [this message]
2013-02-21 23:06 ` [RFC patch 0/8] timekeeping: Implement shadow timekeeper to shorten in kernel reader side blocking Eric Dumazet

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.LFD.2.02.1302261316060.22263@ionos \
    --to=tglx@linutronix.de \
    --cc=dada1@cosmosbay.com \
    --cc=fweisbec@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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.