public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: john stultz <johnstul@us.ibm.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 04/10] tile: convert to use clocksource_register_hz
Date: Thu, 11 Nov 2010 23:22:13 +0100	[thread overview]
Message-ID: <1289514133.2084.207.camel@laptop> (raw)
In-Reply-To: <1289513176.2742.56.camel@work-vm>

On Thu, 2010-11-11 at 14:06 -0800, john stultz wrote:
> 1) How often is sched_clock guaranteed to be called? Once each tick, (so
> the maximum time in nohz mode would be reasonable?)

Never,.. sparc64 for example can stay in nohz mode for hours. We have a
nohz_exit hook for the kernel/sched_clock.c code though which resyncs us
against the GTOD.

> 2) What considerations for sched_clock wrapping is there in generic
> code? I see some considerations in kernel/sched_clock.c, but its not
> obvious the limits. On x86, the 64-bit TSC won't wrap (but might jump on
> non-synced systems, or halt in idle modes). Do architectures that have
> faster-wrapping counters need to handle the cycle accumulation
> internally? 

Basically all code assumes we wrap on the u64 boundary.

So the whole kernel/sched_clock.c machinery tries to make a crummy arch
sched_clock() usable, it syncs against the GTOD code (on tick, idle_exit
and nohz_exit) and only assumes the arch sched_clock() wraps at the u64
boundary, jumps, inter-cpu drift etc are all taken care of.



  reply	other threads:[~2010-11-11 22:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 20:12 [PATCH 00/10] clocksource_register_khz/hz cleanups (for 2.6.38) John Stultz
2010-11-01 20:12 ` [PATCH 01/10] x86: Convert untested clocksources to clocksource_register_hz/khz John Stultz
2010-11-01 20:12 ` [PATCH 02/10] ia64: convert " John Stultz
2010-11-01 20:12 ` [PATCH 03/10] cris: convert to clocksource_register_khz John Stultz
2010-11-01 20:12 ` [PATCH 04/10] tile: convert to use clocksource_register_hz John Stultz
2010-11-11 21:21   ` Chris Metcalf
2010-11-11 22:06     ` john stultz
2010-11-11 22:22       ` Peter Zijlstra [this message]
2010-11-11 23:21         ` john stultz
2010-11-11 22:17     ` john stultz
2010-11-01 20:12 ` [PATCH 05/10] parisc: convert to clocksource_register_hz/khz John Stultz
2010-11-01 20:12 ` [PATCH 06/10] microblaze: " John Stultz
2010-11-10 13:10   ` Michal Simek
2010-11-01 20:12 ` [PATCH 07/10] avr32: Convert to clocksource_register_hz John Stultz
2010-11-01 20:12 ` [PATCH 08/10] blackfin: convert " John Stultz
2010-11-01 20:12 ` [PATCH 09/10] xtensa: convert to clocksource_register_hz/khz John Stultz
2010-11-01 20:12 ` [PATCH 10/10] sparc: " 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=1289514133.2084.207.camel@laptop \
    --to=peterz@infradead.org \
    --cc=cmetcalf@tilera.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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