counters that wrap around

Roger Espel Llima (espel@iAgora.com)
Tue, 25 Aug 1998 14:00:54 -0400


Mitchell Blank Jr wrote:
> 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.

Is it that unreasonable to do something like (forgive the Intel asm
syntax..)

add variable, 1
adc variable64, 0

instead of

inc variable

like we're (I assume) doing now?

Sure, it's a few cycles more, but it's not a horribly complicated test
with conditional jumps... the performance guys should know if the timing
difference would be lost in the noise, or if it'd be actually noticeable.

If it'd be lost in the noise, it's probably worth keeping these things,
at least for uptime and network/vm/etc stats.

otherwise, your polled system sounds like a good way to do it without
affecting the critical paths at all.

-- 
Roger Espel Llima, espel@llaic.u-clermont1.fr                     -o)
http://www.eleves.ens.fr:8080/home/espel/index.html               /\\
                                                                 _\_v

- 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