Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sys-libs/libfreevec replacing glibc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Fri Jan 21, 2011 10:09 am    Post subject: sys-libs/libfreevec replacing glibc Reply with quote

Hello.

Yellow Dog Linux already did that and claimed to be 25% faster (de.wikipedia.org) on G4.
howto_using_libfreevec_using_ld_preload explains how to replace glibc by libfreevec.

Did someone try that? Is it completely compatible? Or does my G4 already use that library?

Regards,
Massimo
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
blob999
n00b
n00b


Joined: 07 Jun 2009
Posts: 64
Location: NATO area

PostPosted: Fri Jan 21, 2011 10:39 am    Post subject: Reply with quote

YDL use it because they removed G3 support.
Gentoo PPC has a generic powerpc support thus it cannot enabled by default.

I used freevec on my AltiVec equipped machines some years ago but today i cannot see a real major gain but only random errors during heavy mem workload... maybe if the author could check his own work and test it against new glibc releases but as I know actually he works fulltime on ARM arch.
If you have a 64bit cpu >= PPC970 you could try the IBM flavour glibc.
_________________
LinuxPPC user!
my blog: http://linuxpowerpc.blogspot.com/
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Fri Jan 21, 2011 11:51 am    Post subject: Reply with quote

Random errors sounds really dangerous. I always have heavy memory workload :)

The benchmarks are tremendous: The G4 even beats the faster Athlon X2.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Sat Jan 22, 2011 5:12 pm    Post subject: Reply with quote

What is the best place to define a LD_PRELOAD= globally? /etc/env.d ?

I tried the 2nd way now:
Code:
echo /usr/lib/libfreevec_libc.so > /etc/ld.so.preload
How can I be sure that library is actually in use? If the path is wrong I get an error for every further ls command.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
blob999
n00b
n00b


Joined: 07 Jun 2009
Posts: 64
Location: NATO area

PostPosted: Mon Jan 24, 2011 12:50 am    Post subject: Reply with quote

you can do a check with ldd
_________________
LinuxPPC user!
my blog: http://linuxpowerpc.blogspot.com/
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Mon Jan 24, 2011 8:40 am    Post subject: Reply with quote

I used libfreevec for 2 days now with heavy memory load without problems.

How would the kernel itself make use of libfreevec? At least when defining $LD_PRELOAD in userspace that would not affect the kernel. I'm not sure about /etc/ld.so.preload.
At the end of this discussion I think it would be useful to have the method how to apply that library described in the elog of sys-libs/libfreevec and maybe, if there are no severe risks, a hint in our PPC FAQ.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Tue Jan 25, 2011 6:11 pm    Post subject: Reply with quote

blob999 wrote:
you can do a check with ldd
Code:
# ldd -v /usr/lib/libfreevec_libc.so
        linux-vdso32.so.1 =>  (0x00100000)
        libc.so.6 => /lib/libc.so.6 (0x6fe31000)
        /lib/ld.so.1 (0x203df000)

        Version information:
        /usr/lib/libfreevec_libc.so:
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
        /lib/libc.so.6:
                ld.so.1 (GLIBC_PRIVATE) => /lib/ld.so.1
                ld.so.1 (GLIBC_2.3) => /lib/ld.so.1
What does that mean?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Tue Jan 25, 2011 7:29 pm    Post subject: First crashes Reply with quote

First crashes with libfreevec:
(I'm going to collect all future identified crashes here in this post...)

Not bad after all, I'm running libfreevec since 2 days and I did not recognize really severe crashes. The following crashes I was able to reproduce and they don't happen after temporarilly disabling libfreevec:

  • Konqueror crashes with Gentoo's bugzilla, such as going to this bug
  • emerge dev-java/xml-commons-external-1.3.04 failed
    Code:
    prepare:
         [echo] Building xml-commons-external (version: 1.3.04) Buildfile: $Revision: 477036 $

    BUILD FAILED
    /var/tmp/portage/dev-java/xml-commons-external-1.3.04/work/xml-commons-external-1.3.04/build.xml:67: Directory /var/tmp/portage/dev-java/xml-commons-external-1.3.04/work/xml-commons-external-1.3.04/build/classes creation was not successful for an unknown reason


_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Thu Jan 27, 2011 9:19 am    Post subject: Reply with quote

I'm considering if these instabilities could be influenced by the combination of libfreevec and CFLAGS/CXXFLAGS/LDFLAGS. By any chance the whole system/world would need to be rebuilt with compatible libfreevec-compatible flags. There must be a stable operation possible if YDL has switched to libfreevec officially.

Today I'm running with quite safe flags:
Code:
CFLAGS="-mcpu=7450 -O2 -pipe -maltivec -mabi=altivec"
LDFLAGS="${LDFLAGS} -Wl,-O1 -Wl,--sort-common"

This was stable for long time now without libfreevec.

Meanwhile I tried to register at freevec.org but no answer yet. Seems the project is idle. I'm going to contact the author markos...
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme


Last edited by Massimo B. on Thu Jan 27, 2011 10:08 am; edited 2 times in total
Back to top
View user's profile Send private message
blob999
n00b
n00b


Joined: 07 Jun 2009
Posts: 64
Location: NATO area

PostPosted: Thu Jan 27, 2011 10:01 am    Post subject: Reply with quote

Massimo B. wrote:
blob999 wrote:
you can do a check with ldd
Code:
# ldd -v /usr/lib/libfreevec_libc.so
        linux-vdso32.so.1 =>  (0x00100000)
        libc.so.6 => /lib/libc.so.6 (0x6fe31000)
        /lib/ld.so.1 (0x203df000)

        Version information:
        /usr/lib/libfreevec_libc.so:
                libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
        /lib/libc.so.6:
                ld.so.1 (GLIBC_PRIVATE) => /lib/ld.so.1
                ld.so.1 (GLIBC_2.3) => /lib/ld.so.1
What does that mean?


you should use ldd to check if libfreevec is enabled.
Here an example (but remember that actually i don't have Gentoo PPC but Crux PPC on this G4 box).

without libfreevec installed
Code:
 root@hellas:~# ldd /bin/cp
        linux-vdso32.so.1 =>  (0x00100000)
        librt.so.1 => /lib/librt.so.1 (0x0ffd8000)
        libacl.so.1 => /lib/libacl.so.1 (0x0ffb1000)
        libattr.so.1 => /lib/libattr.so.1 (0x0ff8d000)
        libc.so.6 => /lib/libc.so.6 (0x0fe0f000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0fdd6000)
        /lib/ld.so.1 (0x48000000)


with libfreevec installed
Code:
 root@hellas:~# ldd /bin/cp
        linux-vdso32.so.1 =>  (0x00100000)
        /usr/lib/libfreevec_libc.so (0x0ffd4000)
        librt.so.1 => /lib/librt.so.1 (0x0ffac000)
        libacl.so.1 => /lib/libacl.so.1 (0x0ff85000)
        libattr.so.1 => /lib/libattr.so.1 (0x0ff61000)
        libc.so.6 => /lib/libc.so.6 (0x0fde3000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0fdaa000)
        /lib/ld.so.1 (0x48000000)


_________________
LinuxPPC user!
my blog: http://linuxpowerpc.blogspot.com/
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Fri Jan 28, 2011 7:55 am    Post subject: History of libfreevec Reply with quote

I talked to markos. Good news everybody, there will be a next release (NG). libfreevec is "alive and evolving, but silently", currently a side project without priority...

While reading History of libfreevec and libfreevec NG, I begin to reconsider the whole gentoo-ppc project, actually whole Linux on PowerPC. The G4 is the main unit among PPC users I guess. Without making use of Altivec it will never deploy its power. G3 has no Altivec and G5 while being faster has a worse implementation of Altivec.
This is like having a Pentium4 running without MMX and SSE*, or like a Dual-Core running only a single core. All memory operations could benefit from Altivec.
When I first saw the G4 (1.6 GHz) compared to the G3 (600 MHz) I was wondering that it was not that much faster. Then on Mac OSX it did not feel being that slow like on Linux, but hard to compare. Now I think glibc not using Altivec is one of the reasons.

Moreover after having a stable libfreevec there is still the kernel not optimized in large areas, but that's another topic.

Now this is not all about PowerPC and not restricted to Altivec, it is about all architectures. GNU/Linux / glibc is not even optimized for x86 or amd64/x86_64. All architectures could benefit from libfreevec and that is what the next libfreevec NG-project is aiming at.

I wonder that nobody in the past had a similar purpose like markos.

Regards,
Massimo

I posted a hint to that discussion into the "Gentoo Chat" subforum for not overlooking this topic down in the PPC subforum.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
mattst88
Developer
Developer


Joined: 28 Oct 2004
Posts: 362

PostPosted: Fri Feb 04, 2011 9:55 pm    Post subject: Re: History of libfreevec Reply with quote

Massimo B. wrote:
GNU/Linux / glibc is not even optimized for x86 or amd64/x86_64.


Haha. Bullshit.

http://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/x86_64/multiarch
http://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/i386/i686/multiarch

While it's not particularly easy to get patches committed to glibc, that's really a better approach instead of having a totally separate library that most people haven't ever heard of. Optimize the library everyone already uses, don't make a new one.
_________________
My 1U Dual 833 MHz Alphaserver DS20L
The AlphaLinux.org Wiki
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1181
Location: PB, Germany

PostPosted: Mon Dec 10, 2012 11:44 am    Post subject: Making use of Altivec Reply with quote

I forgot to mention that I started a general poll at that time: Optimized replacement for glibc in "Off the Wall"

Because people here are more interested in PPC I put that here: I found another interesting project making more use of Altivec:
Tenfourfox I found that when re-installing an old 10.4 beside that stopped working in the way of repartitioning.
Is there any possibility to get their code working on Linux for having a faster fox at least?

EDIT: Just my experience when comparing the latest Linux-ppc Firefox with that G4 optimized Tenfourfox, testing Tenfourfox on the latest G4 PBook with a fresh and "up-to-date" OSX 10.4 installation feels quite slow. Working with around 12 tabs with middle sized text html makes adding and dropping tabs slow. Addons such as Pentadactyl have slow responsiveness. I'm not sure how close the Tenfourfox code is to official Firefox branch, version numbering is similar, but all that Altivec optimization does not seem to help, maybe just comes into play with HTML5 and audio/video media than plain HTML.
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67, 2G(dev.notes[pdf]) | amd64:Core2Duo,i5-3470 | amd64-prefix:OpenSuse@Core2Quad | Lila-Theme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum