lkml.org 
[lkml]   [2003]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fluctuations in /proc/stat btime field
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.054 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site