Fine-grained locking for POSIX local sockets (UNIX domain sockets)

Peter Jeremy peterjeremy at
Wed May 10 10:11:23 UTC 2006

On Wed, 2006-May-10 10:42:39 +0200, Suleiman Souhlal wrote:
>That's not enough. On some CPUs (like the current Opterons), the TSC 
>slows down when the CPU executes a HLT instruction, so if you want good 
>accuracy, you'll need to take that into account too.

The CPU can't be executing any instructions whilst it's halted.  All
you need to do is update the base time/TSC count between when you exit
halt and when you return to userland.

Since most sane code doesn't call gettimeofday() multiple times per
tick, one option might be to unmap the page when the base data becomes
invalid and update/remap the page when it is first accessed.

Peter Jeremy

More information about the freebsd-performance mailing list