[lkml]   [2001]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Patch] Re: Nasty suprise with uptime
On Thu, 1 Nov 2001, vda wrote:

> On Thursday 01 November 2001 00:52, Tim Schmielau wrote:
> > OK, absolutely last patch for today. Sorry to bother everyone, but the
> > jiffies wraparound logic was broken in the previous patch.
> >
> > As stated before, I would kindly ask for widespread testing PROVIDED IT IS
> I see you dropped jiffies_hi update in timer int.
> IMHO argument on wasting 6 CPU cycles or so per each timer int:
> - jiffies++;
> + if(++jiffies==0) jiffies_hi++;
> is not justified. I'd rather see simple and correct code in timer int
> rather than jumping thru the hoops in get_jiffies_64().
> For CPU cycle saving zealots: I advocate saving 2 static longs in get_jiffies
> instead :-)
> --
> vda
> -

Well not exactly zealots. I test a lot of stuff. In fact, the code
you propose:

if(++jiffies==0) jiffies_hi++;

... actually works quite well:

Script started on Thu Nov 1 10:23:54 2001
# ./chk
Simple bump = 13
Bump chk and incr = 15
# ./chk
Simple bump = 13
Bump chk and incr = 15
# ./chk
Simple bump = 13
Bump chk and incr = 15
# exit
Script done on Thu Nov 1 10:24:08 2001

It adds only two CPU clock cycles if (iff) the 'C' compiler is
well behaved.

Test code is appended. In the test code, I calculate everything, then
print the results. This is so the 'C' library + system call doesn't
mess up the cache. Note this if you use this as a template to test
other questionable code snippets.

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.

[unhandled content-type:application/octet-stream]
 \ /
  Last update: 2005-03-22 13:12    [W:0.111 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site