tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sysctl's in modules - specifically compat_netbsd32

On Sun Dec 14 2008 at 03:46:28 +0200, Antti Kantee wrote:
> Incidentally, sysctl node registrations in general should move away from
> link sets to provide for modules.  I did a little bit of it recently,
> but there's still a lot left.

Someone asked privately to elaborate this.  Here's my response:

Currently SYSCTL_SETUP() does link_set_add.  This is processed at kernel
boottime in sysctl_init().  For any modules loaded later the linkset
constructors are not automagically called.

There are basically two choices:
  1) make each module constructor explicitly initialize any services,
     data, etc. it wants, such as sysctl nodes
  2) teach the module loading code to know about all the possible
     linksets a module can provide.  other examples include malloc
     types and bufq strategies

Obviously 1 is better for abstraction.
("module" means a functional unit from the sysctl standpoint, which is
not necessarily equivalent to a kernel module, although it can be.
an example of a non-kernelmodule could be vfs_bio)

So in the end there should be 0 calls to SYSCTL_SETUP().

hope that helps,

Home | Main Index | Thread Index | Old Index