Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2001 17:15:35 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        terry@lambert.org, current@FreeBSD.org
Subject:   Re: PATCH to make maxfiles, maxfiles per proc boot-time tunable
Message-ID:  <XFMail.010426171535.jhb@FreeBSD.org>
In-Reply-To: <200104262310.QAA29635@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 26-Apr-01 Terry Lambert wrote:
> ] The problem is that param.c is *not* included in gensetdefs scope.
> ] Therefore linker set entries (ie: SYSINIT etc) are not executed.  TUNABLE*
> ] entries in param.c are simply not called or used.
> ] 
> ] SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o
> config.o \
> ]         setdef1.o hack.So
> ] ...
> ] setdef0.c setdef1.c setdefs.h: ${OBJS}
> ]         @gensetdefs ${OBJS}
> ] 
> ] param.o is not included in ${OBJS}.  I dont see how this patch can work
> ] as-is.
> 
> Has this changed in -current?
> 
> I'm running on 4.3-RELEASE (now), and it has no problems.
> 
> Are you sure you aren't linking param.o into your kernel anywhere?
> 
> It's the linker that does the magic, not anything else (as you know);
> I can assure you it's running fine on my 4.3 box.

Umm, tunable_int sets up a sysinit to do the setting of the variable.  This
depends on there being a linker set for the sysinit code to see.  Hmmm *checks
link order*.  Ok, param.o is in between setdef0.o and setdef1.o so it does get
included in the linker set ok, but gensetdefs doesn't see it, so the count of
the number of items in a linker set is bogus and invalid.  If the code depends
on that count then the sysinit's in param.o will be ignored.  If the code just
keeps walking down the set until it hits the NULL entry at the end, it will
work.  Hmm, looking at the bubble sort in mi_startup(), it runs until it hits
NULL and doesn't check the linker set count, which is why tunable's in param.c
works, even though it is incorrect.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010426171535.jhb>