All of lore.kernel.org
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dimitri Sivanich <sivanich@sgi.com>,
	mingo@elte.hu, tglx@linutronix.de, linux-kernel@vger.kernel.org,
	hpa@zytor.com
Subject: Re: [PATCH 1/2 v3] SGI RTC: add clocksource driver
Date: Thu, 20 Nov 2008 16:08:08 -0800	[thread overview]
Message-ID: <1227226089.6921.13.camel@localhost.localdomain> (raw)
In-Reply-To: <20081120150813.d7d1901e.akpm@linux-foundation.org>

On Thu, 2008-11-20 at 15:08 -0800, Andrew Morton wrote:
> On Wed, 19 Nov 2008 15:23:50 -0600
> Dimitri Sivanich <sivanich@sgi.com> wrote:
> 
> > This patch provides a driver for SGI RTC clocks and timers.
> > 
> > This provides a high resolution clock and timer source using the SGI
> > system-wide synchronized RTC clock/timer hardware.
[snip]
> > +static struct clocksource clocksource_uv = {
> > +	.name		= RTC_NAME,
> > +	.rating		= 400,
> > +	.read		= uv_read_rtc,
> > +	.mask		= (cycle_t)UVH_RTC_REAL_TIME_CLOCK_MASK,
> > +	.shift		= 0,
> > +	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
> > +};

Hey Dimitri,
	One issue with this clocksource is the shift value. The clocksource
frequency is calculated from the mult/shift pair (f = mult/2^shift).
When NTP steers the clock in the generic timekeeping code, it does so by
tweaking the mult value up or down. However if the shift value is too
low, that ends up being quite a large change to the frequency.

So in order to get fine grained frequency adjustments I'd recommend
using a larger shift value (8 at least). Ideally you want the largest
shift value possible, but some care is needed that it isn't too big,
because larger shift values mean larger mult values, and you don't want
to overflow on the multiplication.

A rule of thumb I use is to find a shift value so the resulting mult
value won't overflow 1 second worth of cycles.

thanks
-john


  reply	other threads:[~2008-11-21  0:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 16:30 [PATCH 0/2 v2] SGI RTC: add clocksource/clockevent driver Dimitri Sivanich
2008-10-23 16:32 ` [PATCH 1/2 v2] SGI RTC: add clocksource driver Dimitri Sivanich
2008-10-23 16:34   ` [PATCH 2/2 v2] SGI RTC: add RTC system interrupt Dimitri Sivanich
2008-10-24  3:11     ` [PATCH 2/2 v3] " Dimitri Sivanich
2008-10-27 14:08       ` Ingo Molnar
2008-10-27 15:29         ` Dimitri Sivanich
2008-11-19 21:22 ` [PATCH 0/2 v3] SGI RTC: add clocksource/clockevent driver and generic timer vector Dimitri Sivanich
2008-11-19 21:23   ` [PATCH 1/2 v3] SGI RTC: add clocksource driver Dimitri Sivanich
2008-11-19 21:26     ` [PATCH 2/2 v3] SGI RTC: add generic timer system interrupt Dimitri Sivanich
2008-11-20 23:12       ` Andrew Morton
2008-11-20 23:19         ` H. Peter Anvin
2008-11-21 17:15           ` Dimitri Sivanich
2008-11-21 18:26             ` H. Peter Anvin
2008-11-21 19:09               ` Yinghai Lu
2008-11-23 13:36               ` Ingo Molnar
2008-11-21 17:21         ` Dimitri Sivanich
2008-11-20 23:08     ` [PATCH 1/2 v3] SGI RTC: add clocksource driver Andrew Morton
2008-11-21  0:08       ` john stultz [this message]
2008-11-21 17:23         ` Dimitri Sivanich
2008-11-20  9:59   ` [PATCH 0/2 v3] SGI RTC: add clocksource/clockevent driver and generic timer vector Ingo Molnar
2008-11-21  1:44     ` H. Peter Anvin
2008-11-21  8:06       ` Ingo Molnar
2008-11-21 17:16       ` Dimitri Sivanich

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=1227226089.6921.13.camel@localhost.localdomain \
    --to=johnstul@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sivanich@sgi.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 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.