mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Paul Mackerras <paulus@samba.org>
Cc: Roman Zippel <zippel@linux-m68k.org>,
	torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Provide an interface for getting the current tick length
Date: Thu, 16 Feb 2006 16:53:02 -0800	[thread overview]
Message-ID: <1140137582.7028.69.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <17397.7198.893154.620097@cargo.ozlabs.ibm.com>

On Fri, 2006-02-17 at 11:43 +1100, Paul Mackerras wrote:
> john stultz writes:
> 
> > > +	if (time_adjust_step)
> > >  		/* Reduce by this step the amount of time left  */
> > >  		time_adjust -= time_adjust_step;
> > 
> > Does the if statement really buy you anything here? 
> 
> Well, just avoiding dirtying a cache line in the common case where
> time_adjust and time_adjust_step are zero, that's all.  It's a very
> minor thing.  In fact if time_adjust is zero we could avoid the
> procedure call, the subtraction and the multiplication by 1000, like
> this:
> 
> 	delta_nsec = tick_nsec;
> 	if (time_adjust) {
> 		time_adjust_step = adjtime_adjustment();
> 		/* Reduce by this step the amount of time left  */
> 		time_adjust -= time_adjust_step;
> 		delta_nsec += time_adjust_step * 1000;
> 	}

Yea, I was thinking if you weren't going to do it for the mult, why
bother on the subtract. Either way, I'm not too picky, it should just be
consistent.

> > > +u64 current_tick_length(void)
> > > +{
> > > +	long delta_nsec;
> > > +
> > > +	delta_nsec = tick_nsec + adjtime_adjustment() * 1000;
> > > +	return ((u64) delta_nsec << (SHIFT_SCALE - 10)) + time_adj;
> > > +}
> > 
> > You've got time_adj here, but you're not using what's been accumulated
> > in time_phase, is that really ok?
> 
> Yes.
> 
> What's been accumulated in time_phase is always less than a
> nanosecond's worth.  I took the approach of delivering the full
> precision of time_adj to the arch code (i.e. including the 12 bits to
> the right of the binary point), rather than truncating it to whole
> nanoseconds and then having to vary it by +/- 1 nanosecond each tick.

So you're accumulating it yourself in the arch code? That's fine, I just
wanted to be sure.

Acked-by: john stultz <johnstul@us.ibm.com>

thanks
-john


  reply	other threads:[~2006-02-17  0:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-16 23:30 Paul Mackerras
2006-02-17  0:11 ` john stultz
2006-02-17  0:43   ` Paul Mackerras
2006-02-17  0:53     ` john stultz [this message]
2006-02-17 12:43   ` Roman Zippel

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=1140137582.7028.69.camel@cog.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=torvalds@osdl.org \
    --cc=zippel@linux-m68k.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®