Re: Suggestions on Avoiding syscall Overhead

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Sat, 28 Apr 2007 11:39:24 +0100 (BST)
On Tue, 24 Apr 2007, Dag-Erling Smørgrav wrote:

> David G Lawrence <dg_at_dglawrence.com> writes:
>> gettimeofday(2) returns microsecond precision, so I don't see how this 
>> could be made accelerated via a mapped global page. time(3) [which is 
>> currently a wrapper for gettimeofday(2)], on the other had, could be put 
>> into such a page since it only updates once a second.
>
> gettimeofday(2) returns a value in microseconds, but this does not 
> necessarily mean that it has microsecond precision.  Updating it once per 
> scheduler tick or once per context switch (in userret(), for instance) is 
> probably enough.

We have an overall issue with the cost vs prevision of time measurement in 
FreeBSD.  We err on the side of precision; other systems err on the side of 
cost.  I'm not sure that gettimeofday() is best optimized in the way you 
describe, since if we're going to sacrifice precision, we could sacrifice a 
lot less precision and still get massively better performance.

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Sat Apr 28 2007 - 08:39:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:09 UTC