Subject: Re: Enhancing sysctl support in ld.elf_so
To: Christos Zoulas <>
From: Andrew Brown <>
List: tech-userlevel
Date: 06/21/2004 01:12:37
On Mon, Jun 21, 2004 at 05:02:46AM +0000, Christos Zoulas wrote:
>In article <>,
>Andrew Brown <> wrote:
>>On Sun, Jun 20, 2004 at 03:37:40PM -0700, Matt Thomas wrote:
>>>At 12:10 PM 6/20/2004, Quentin Garnier wrote:
>>>>Le Sun, 20 Jun 2004 19:47:02 +0200 (CEST)
>>>>Jaromir Dolecek a ecrit :
>>>> > Quentin Garnier wrote:
>>>> > -- Start of PGP signed section.
>>>> > > Hi,
>>>> > >
>>>> > > I made a patch to make ld.elf_so use the new sysctl API instead of the
>>>> > > limited functionality it has now.
>>>> > >
>>>> > > It's handy, but adds 12k to ld.elf_so.
>>>> > >
>>>> > > Comments?
>>>> >
>>>> > What new features are provided by the new code, besides
>>>> > using the new sysctl API (which is irrelevant) ?
>>>>It allows the use of any sysctl variable in /etc/  I can't say
>>>>it is a must have, but it's clearly handy in some case, such as with
>>>>third-party libraries and such that would depend on specific features of
>>>>the kernel.
>>>>That's why I ask if those 12k are worth the feature, but nobody commented
>>>>on that yet.
>>>It isn't the 12K that bothers me, it's whether it slows down ld.elf_so
>>>at all.  So, does it slow it down?  I assume the sysctlmib is only
>>>initialized if needed, right??
>>calling sysctlgetmibinfo() costs at least one call to sysctl() each
>>time you call it (unless a private mib tree is used) and possibly up
>>to "n" where "n" is the number of levels deep into the tree you are
>>looking.  caching helps mitigate this for frequent callers, but
>>ld.elf_so probably won't be a "frequent caller".
>So we should leave things as they are.

meaning that ld.elf_so won't use sysctlgetmibinfo() (or, by extension,
sysctlbyname())?  that means that any node that ld.elf_so will ever
look up will have to be assigned a static mib entry, and that
ld.elf_so will continually need to be updated (along with the #defines
that describe the static mib) to be able to traverse it.  that's
tricky, and was done wrong in the past (cf, the vfs.lfs nodes that i
"found" when converting everything which weren't previously available
because code to find them was never written).

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."