This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Re: RFC: ldconfig speedup


On Fri, Jul 27, 2007 at 02:20:06PM +0200, Andreas Jaeger wrote:
> > 1) ldconfig uses the /var/cache/ldconfig/aux-cache cache only to speed up
> >    mapping of the cache_entry_id -> { flags, osversion, soname }
> >    so what's the point of aux_cache_file_entry containing value (aka path)
> >    or hwcap?
> 
> I don't see a need for them either anymore.
> 
> > 2) the aux_entries linked list will usually contain roughly 2000+ entries,
> 
> Mine has 2053 - so I agree ;-)

While working on 1) and 2), I noticed a few other issues, e.g. the aux cache
containing many entries with { 0, 0, 0, 0 } id and problems with soname and
flags being modified from what was really read from the file based e.g. on
filename or directory and decided it will be better
to decouple the aux cache handling from normal cache handling completely.
After all, it contains different data in it and serves different purpose.
So, in the attached updated patch the aux cache is caching only
what process_file_name returns for each { ino, dev, ctime, size } quadruple.
process_file_name has been changed so that it only returns soname if the
file really had a DT_SONAME (i.e. something embedded in it) and there is a
new function the callers can use to compute implicit SONAME from the
filename if explicit DT_SONAME is not present (the aux cache caches only
on ino/dev/ctime/size, so if you have e.g. hardlinks and no DT_SONAME
in it, ldconfig without aux cache would return two different sonames while
with aux cache would otherwise give the same soname for both).
A simple hash table is used (haven't bothered with hash table growth,
in most cases it will be big enough and worst case the chains will be
slightly longer).
As an added bonus, the aux cache is used immediately, so even when no
/var/cache/ldconfig/aux-cache is present, process_file_name will be
at most once for each { ino, dev, ctime, size } quad, while before
we were calling e.g. for all symlinks pointing to the file and also the
regular file.

	Jakub

Attachment: M6
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]