Date: Tue, 16 Jan 2001 17:28:59 -0800 From: Alfred Perlstein <bright@wintelcom.net> To: Terry Lambert <tlambert@primenet.com> Cc: Kirk McKusick <mckusick@mckusick.com>, arch@FreeBSD.ORG Subject: Re: dynamic vs static sysctls? Message-ID: <20010116172859.B7240@fw.wintelcom.net> In-Reply-To: <200101170125.SAA19549@usr08.primenet.com>; from tlambert@primenet.com on Wed, Jan 17, 2001 at 01:25:43AM %2B0000 References: <20010115223342.L7240@fw.wintelcom.net> <200101170125.SAA19549@usr08.primenet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* Terry Lambert <tlambert@primenet.com> [010116 17:25] wrote:
> > I like this optimization, the only problem is that there's a chance
> > that a dynamic sysctl may disapear out from under you, and even
> > worse, replaced by an unrelated writeable one.
> >
> > Perhaps you should include a generation count within the sysctl to
> > prevent this sort of potential problem? So besideds passing the
> > sysctl number, you would include a generation count and error out
> > if both numbers didn't match?
>
> Dynamically created OIDs should:
>
> 1) Monotonically increase
They don't seem to, this is the main problem with doing any translation,
it looks like:
/*
* If this oid has a number OID_AUTO, give it a number which
* is greater than any current oid. Make sure it is at least
* 100 to leave space for pre-assigned oid numbers.
*/
if (oidp->oid_number == OID_AUTO) {
/* First, find the highest oid in the parent list >99 */
n = 99;
SLIST_FOREACH(p, parent, oid_link) {
if (p->oid_number > n)
n = p->oid_number;
}
oidp->oid_number = n + 1;
}
Could cause some issues because it seems that if a sysctl were to
"go away" the next one to apear under the same level will replace
its number.
>
> 2) Be illegal to cache over reboots
of course!
>
> 3) Reset on reboots
ditto.
--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010116172859.B7240>
