lkml.org 
[lkml]   [1998]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 498+ days uptime
> I think using 64-bit counters on i386 is unreasonable.  These counters
> are often incremented in extremely performance-critical areas. Using
> a polled system where the kernel remembers when 32-bit counters overflowed
> might be workable.

Incrementing a 64-bit value on i386 is fast and simple. It's arithmetic
done in GCC, especially with temporaries that you have to worry about.

The instruction sequence is:

incl counter
adcl $0,counter+4

This could be made into a kernel macro. Because the carry is so rare,
you could safely use a lock prefix before the incl and put this in a
macro called atomic_count or something.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

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