All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kingsley Cheung <kingsley@aurema.com>
To: linux-kernel@vger.kernel.org
Subject: Re: fluctuations in /proc/stat btime field
Date: Thu, 20 Mar 2003 12:47:55 +1100	[thread overview]
Message-ID: <20030320124755.A5602@aurema.com> (raw)
In-Reply-To: <20030319154554.C3492@aurema.com>; from kingsley@aurema.com on Wed, Mar 19, 2003 at 03:45:54PM +1100

On Wed, Mar 19, 2003 at 03:45:54PM +1100, Kingsley Cheung wrote:
> Hi,
> 
> On a dual SMP box running SuSE-2.4.19-79 (United Linux rc4), the boot
> time in /proc/stat can vary 1 second when read.  I haven't seen this
> on a UP box. Its not a major issue, but I guess its a hindrance if
> one's expecting it to never change:
> 
> gen2 12:06:52 ~: grep btime /proc/stat
> btime 1046838984
> gen2 12:07:06 ~: grep btime /proc/stat
> btime 1046838984
> gen2 12:07:07 ~: grep btime /proc/stat
> btime 1046838983
> gen2 12:07:07 ~: grep btime /proc/stat
> btime 1046838983
> gen2 12:07:08 ~: grep btime /proc/stat
> btime 1046838983
> gen2 12:07:09 ~: grep btime /proc/stat
> btime 1046838984
> gen2 12:07:10 ~: grep btime /proc/stat
> btime 1046838984
> gen2 12:07:11 ~: grep btime /proc/stat
> btime 1046838983
> 
> I'm not familiar with the way IO-APIC timers work or the interrupt
> timer itself, so can someone explain why this is the case? I'm
> guessing that it might simply be a timing issue between when the
> actual interrupt handling updating jiffies in do_timer and the bottom
> half updating xtime.tv_sec (see kernel/timer.c). 
> 
> Maybe by caching the btime value so that its only calculated once is
> the way to go. Attached is the suggested fix, as well as the output
> from /proc/cpuinfo & /proc/interrupts.
> 
> If someone could get back to me on this it would be much appreciated.
> 

Actually, correction: the boot-time does also fluctuate on a UP as
well.  Not nice if you want absolute boot-time.

-- 
		Kingsley

      reply	other threads:[~2003-03-20  1:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-19  4:45 fluctuations in /proc/stat btime field Kingsley Cheung
2003-03-20  1:47 ` Kingsley Cheung [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=20030320124755.A5602@aurema.com \
    --to=kingsley@aurema.com \
    --cc=linux-kernel@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 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.