On Fri, 2010-04-02 at 11:13 -1000, Eric Anholt wrote:
> On Mon, 29 Mar 2010 14:59:35 -0400, Adam Jackson <[email protected]> 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 <[email protected]>
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.

- ajax

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to