Date: Mon, 15 Nov 2010 13:09:23 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: Garrett Cooper <yanegomi@gmail.com> Subject: Re: Phantom sysctl Message-ID: <201011151309.23068.jhb@freebsd.org> In-Reply-To: <AANLkTik0CgFYKfaGKGktKtUjotfRFjKPOPPbecMRpWDS@mail.gmail.com> References: <AANLkTik0CgFYKfaGKGktKtUjotfRFjKPOPPbecMRpWDS@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, November 15, 2010 12:53:57 pm Garrett Cooper wrote: > According to SYSCTL_INT(9): > > The SYSCTL kernel interfaces allow code to statically declare sysctl(8) > MIB entries, which will be initialized when the kernel module containing > the declaration is initialized. When the module is unloaded, the sysctl > will be automatically destroyed. > > The sysctl should be reaped when the module is unloaded. My dumb > test kernel module [1] doesn't seem to do that though (please note > that the OID test_int_sysctl is created, and not reaped... FWIW it's > kind of bizarre that test_int_sysctl is created in the first place, > given what I've seen when SYSCTL_* gets executed): I believe I have seen this work properly before. Look for 'sysctl' in sys/kern/kern_linker.c to see the sysctl hooks invoked on kldload and kldunload to manage these sysctls. You will probably want to start your debugging in the unload hook as it sounds like the node is not being fully deregistered. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011151309.23068.jhb>