[lkml]   [2001]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Patch] Re: Nasty suprise with uptime
On Wed, 31 Oct 2001, Tim Schmielau wrote:

> > > I would say that the race is so rare that it should not be handled,
> > > especially since it adds extra code in the timer interrupt.
> >
> The expensive code in the timer interupt will be executed every
> 497.1 days, so that's bearable.

The expensive code in the timer interrupt will be executed every
timer interrupt! There is no magic way to connect two 32-bit long-words
to make a 64-bit object, no matter how well it's hidden by the 'C'
compiler. An increment of the low long-word won't magically bump the
high long-word. This takes code, and the simplist code to do it was
shown. This:
adcl $1,(jiffies) # INCL won't set CY 4 clocks
adcl $0,(jiffies_hi) # 4 clocks
... takes 8 clocks.
incl (jiffies)
... takes 2 clocks

Also gcc isn't as "kind" as this. It generates volumes of strange
code to bump a 'long long'.

That's 6 extra clocks every Hz or 600 clocks per second. By the time
you've reached the 497.1 days, you have wasted.... 0xffffffff/6 =
715,827,882 CPU clocks just so 'uptime' is correct? I don't think
so. I'd reboot.

Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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