[PATCH resent] configure: introduce --{enable, disable}-syscall-clock

Daniel Stone daniel at fooishbar.org
Mon Apr 19 00:12:39 PDT 2010


On Fri, Apr 16, 2010 at 03:10:19PM +0300, Tiago Vignatti wrote:
> Some Linux systems might not want to link against rt and pthread libraries
> simply to implement monotonic clock (GetTimeInMillis). For those, use a direct
> syscall instead. This is discouraged if someone doesn't know what's doing.
> 
> This patch keeps the new syscall version disabled by default - therefore not
> changing the original behaviour of the xserver build.
> 
> One, using this patch, should worry about a possible performance degradation
> due it's not going through optimized code in C library. Therefore, the simple
> program bellow (kudos to Adam Jackson) should performs equally in the practice,
> for both syscall and C library implementation:
> 
>   #ifdef SYSCALL_MONOTONIC_CLOCK
>   #define clock_gettime(a, b) syscall(SYS_clock_gettime, a, b)
>   #endif
>   [...]
> 
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
> Myself, ajax, alanc and others discussed already on IRC about the performance
> degradation. We all ran the program above, obtaining equally results within
> different environments.

Jesus wept.  We've spent the last six years _deleting_ this kind of
code. ;) Was there any actual performance degradation from linking librt
in the end, or was it just about memory usage? I remember the Intel guys
saying that just linking to libpthread made lock overhead show up in
their profiles, but IIRC the solution to that was to remove superfluous
locks ...

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100419/07d533f3/attachment.pgp>


More information about the xorg-devel mailing list