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

Eric Anholt eric at anholt.net
Tue Apr 6 16:25:07 PDT 2010


On Mon, 05 Apr 2010 10:20:04 -0400, Adam Jackson <ajax at redhat.com> wrote:
> On Fri, 2010-04-02 at 11:13 -1000, Eric Anholt wrote:
> > On Mon, 29 Mar 2010 14:59:35 -0400, Adam Jackson <ajax at redhat.com> wrote:
> > > Yeah, it's not really something I want Linux to default to using either.
> > > I mean, we're going to want input threads, so slicing off librt just
> > > because it pulls in libpthread is a bit temporary.  And Mesa's GLX
> > > support pulls in pthreads already, so the class of device where this
> > > applies is pretty thin.
> > 
> > At the moment, clock_gettime() is the only reason I can't get Mesa off
> > of libpthread.  Before a bunch of ugly hacking in libdrm, the overhead
> > From pthreads presence was around 10% CPU time on CPU-bound apps on
> > i965.  These days it's down to a few percent.
> 
> I'm not sure you're blaming the right piece of the world there.  If
> you're referring to:
> 
> commit 0d7ad7e43ca212b1e9f16cd18f36493cab455e61
> Author: Eric Anholt <eric at anholt.net>
> Date:   Tue Oct 20 14:19:38 2009 -0700
> 
>     intel: Only call clock_gettime once per unreference_final.
> 
> then I'm pretty sure the overhead there was calling clock_gettime at
> all.  The implementation doesn't have any interaction with thread
> support.  Compare runtimes from:
> 
> http://people.freedesktop.org/~ajax/syscall/
> 
> Pretty sure you'll find them to be just about identical.
> 
> > It seems to me like the real problem is that clock_gettime() isn't in
> > glibc without the pthreads cost.  Perhaps someone could look into that
> > instead of hacking around it in its consumers?
> 
> The clock_gettime() implementation is in librt because that's where all
> the POSIX realtime stuff lives.  Moving it into glibc wouldn't be
> especially difficult, though you'd need to get the symbol versioning
> right.

No, I was talking about this problem:
anholt at pollan:anholt/src/glsl2% ldd /usr/lib/librt.so 
	linux-gate.so.1 =>  (0xffffe000)
	libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7761000)
	libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7748000)
	/lib/ld-linux.so.2 (0xb78cd000)

By linking to librt to get clock_gettime, we pull in real pthreads, and
all the mutex lock/unlocks everywhere else in our code go from free to
ow ow ow stop it already.  So we've relaxed a bunch of the locking in
libdrm_intel and left it up to the user where the user was doing locking
anyway for its requirements, and we've cut down the number of calls made
to the parts that still do locking.
-------------- 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/20100406/981e2a39/attachment.pgp>


More information about the xorg-devel mailing list