preloading of binaries

Michael Matz matz at kde.org
Mon Mar 8 20:30:37 CET 2004


Hi,

On Mon, 8 Mar 2004, Dr. Juergen Pfennig wrote:

> On Monday 08 March 2004 14:19, Lubos Lunak wrote:
> 
> >  I'd need some people to test the the following hack. In startkde, before
> > KDE is loaded, a small utility mmap()'s basic large libraries used by KDE
> > and walks over them, causing them to be all loaded into memory, and they'll
> > stay cached (I think OO.o uses a similar hack). As the mmap() is done with

I only subscribed to kde-optimize now, but I would suggest to actually
only map the necessary ELF segments (i.e. those marked PT_LOAD), instead
of the whole file (I didn't see the patch so don't know if this is already
done).

> Did you also try just to open the .so files to make the Kernel cache the 
> directory entries?

This is mostly useless.  You really want to buffer the whole content of 
the DSO which is needed later.  Just the directory entry isn't enough at 
all and in fact not any bottleneck.

> But please: under no circumstance read the whole files via mmap. 30'% of it is 
> symbol info and large parts may be messages or code that is never used. What 
> about just reading the .dynamic section (or what the precise name is). Your 
> hack (reading the whole file) could also cause a desaster on machines that 
> are under memory stress!

Yes, mmaping the whole file really should be avoided.

> Here a suggestion: I believe that it was Coolo who was extending the
> kdeinit launch trick for KDE 3.2.

The normal pre-dlopen plus fork is done by kdeinit since quite some time.

> to match import/export symbol tables is saved (kdeinit preloads some .so
> objects?).  Why don't you work on some tricks to extend kdeinit further?


Ciao,
Michael.


More information about the Kde-optimize mailing list