Messages in this thread | | | Date | Tue, 25 Aug 1998 14:19:46 +0100 | From | Jamie Lokier <> | Subject | Re: [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
| |