mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Paul Mackerras <paulus@samba.org>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, johnstul@us.ibm.com
Subject: Re: [PATCH] Provide an interface for getting the current tick length
Date: Wed, 15 Feb 2006 18:08:48 -0800	[thread overview]
Message-ID: <20060215180848.4556e501.akpm@osdl.org> (raw)
In-Reply-To: <17395.56186.238204.312647@cargo.ozlabs.ibm.com>

Paul Mackerras <paulus@samba.org> wrote:
>
> Andrew Morton writes:
> 
> > >  +	if ((time_adjust_step = time_adjust) != 0 ) {
> > 
> > <mutters something about coding style>
> 
> Seems perfectly plain to me, but if you don't like it I can change it.
> 

[random space before right-paren?]

	time_adjust_step = time_adjust;
	if (time_adjust_step) {

would be more conventional.  Some like the `!= 0' as well - personally I
find that a net distraction.

Ah, you copied-and-pasted from update_wall_time_one_tick().

Can we share that code?

> > 
> > >  +		/*
> > >  +		 * Limit the amount of the step to be in the range
> > >  +		 * -tickadj .. +tickadj
> > >  +		 */
> > >  +		time_adjust_step = min(time_adjust_step, (long)tickadj);
> > >  +		time_adjust_step = max(time_adjust_step, (long)-tickadj);
> > >  +	}
> > >  +	delta_nsec = tick_nsec + time_adjust_step * 1000;
> > 
> > Is that going to overflow if sizeof(long) == 4?
> 
> No.  time_adjust_step is in microseconds and is restricted to the
> range -tickadj .. tickadj, and tickadj is between 1 and 10 (assuming
> HZ >= 50).  tick_nsec is around 1e9 / HZ.  There's no way delta_nsec
> could end up less than 0 or larger than around 20 million for any
> reasonable HZ value (i.e. >= 50).
> 

ok...

  reply	other threads:[~2006-02-16  2:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-16  1:17 Paul Mackerras
2006-02-16  1:35 ` Andrew Morton
2006-02-16  1:55   ` Paul Mackerras
2006-02-16  2:08     ` Andrew Morton [this message]
2006-02-16  2:54       ` Paul Mackerras
2006-02-16  3:11         ` Andrew Morton
2006-02-16  3:18           ` Paul Mackerras
2006-02-16  3:30         ` Linus Torvalds
2006-02-16  3:43           ` Paul Mackerras
2006-02-16  3:51             ` Linus Torvalds

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=20060215180848.4556e501.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=torvalds@osdl.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®