public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: sched_clock
Date: Fri, 04 Jun 2004 22:52:25 +0000	[thread overview]
Message-ID: <16576.64809.757551.150988@napali.hpl.hp.com> (raw)
In-Reply-To: <40B4868F.B649611C@nospam.org>

>>>>> On Fri, 04 Jun 2004 13:11:26 +0200, Zoltan Menyhart <Zoltan.Menyhart_AT_bull.net@nospam.org> said:

  Zoltan> David Mosberger wrote:
  >>  Yes, you're right, there is an intermediate-result overflow
  >> problem in sched_clock() that I missed.  How does the attached
  >> patch work for you?

  Zoltan> Thank you, it is O.K.

Thanks for checking it out.

  Zoltan> On the other hand, we might have similar problems in
  Zoltan> fsys.S. Some comments like the one below makes me worry a
  Zoltan> bit:

  Zoltan> 	// if now < last_tick, set p7 = 1, p8 = 0

  Zoltan> I cannot really say that I fully understand what is in
  Zoltan> fsys.S, but should not "now" always be after no matter what
  Zoltan> time stamp, last tick ?

No, the "<" there is done with 64-bit modular arithmetic so this code
is fine (it's the equivalent of the time_before() macro).

The ia64-specific code is very careful to work correctly even when the
ITC wraps around.  sched_clock() is a (platform-independent) exception
and it is OK because, in the worst case, an overflow will lead to a
scheduling hiccup.  Basically, the scheduler will simply "think" that
a task slept for NS_MAX_SLEEP_AVG when it may have slept much less
(there may be some other minor hiccups, but that should be pretty much
it, AFAICT).

	--david

      parent reply	other threads:[~2004-06-04 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 11:59 sched_clock Zoltan Menyhart
2004-06-03 22:46 ` sched_clock David Mosberger
2004-06-04  9:43 ` sched_clock Ingo Molnar
2004-06-04 11:02 ` sched_clock Andi Kleen
2004-06-04 11:11 ` sched_clock Zoltan Menyhart
2004-06-04 22:23 ` sched_clock David Mosberger
2004-06-04 22:52 ` David Mosberger [this message]

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=16576.64809.757551.150988@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.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