On Mon, 05 Apr 2010 10:20:04 -0400, Adam Jackson <a...@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 <a...@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 <e...@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:
anh...@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.

Attachment: pgpsqlpMi4avd.pgp
Description: PGP signature

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to