Date: Thu, 26 Feb 2004 17:22:42 -0500 From: John Baldwin <john@baldwin.cx> To: arch@FreeBSD.org Cc: rwatson@freebsd.org Subject: Re: per-device sysctls Message-ID: <200402261722.42523.john@baldwin.cx> In-Reply-To: <20040226.130200.112722727.imp@bsdimp.com> References: <Pine.NEB.3.96L.1040226135237.79901X-100000@fledge.watson.org> <xzphdxdk690.fsf@dwp.des.no> <20040226.130200.112722727.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 26 February 2004 03:02 pm, M. Warner Losh wrote: > In message: <xzphdxdk690.fsf@dwp.des.no> > > des@des.no (Dag-Erling Sm=F8rgrav) writes: > : Robert Watson <rwatson@freebsd.org> writes: > : > Having a unified and managed namespace for device sysctls sounds like= a > : > generally good idea to me, as more and more devices require some of > : > another tweaking. Have you had any thoughts on how to name sysctls a= nd > : > kernel environment variables on a per-driver basis, rather than a > : > per-device basis? I.e., fxp and some other device drivers have > : > configuration settings that affect all instances of devices, rather > : > than specific instances. > : > : It should be easy to add a per-devclass_t or per-driver_t sysctl > : context and tree. These things are disgustingly easy to create; the > : only hard part is figuring out when and where to create them. > > You'd need to have devclass as well as dev trees, but that's easy to > do. We have hw.tsc.<driver>.<stat> sysctls for all the drivers at > work, and it would be nice to have a more general framework to put > stuff like that into. > > It would be nice if there was some kind of tie-in to tunables as well, > since many drivers have tunables that are global, but might want to be > less global. Maybe 'dev.foo0.bar0' for devices, and 'driver.foo' are things specific to = the=20 foo driver, though really that would have to be devclass.foo. Drivers can= =20 have the same names, so that gets harder. E.g., we have multiple pci(4)=20 drivers and multiple pcib(4) drivers. So you couldn't just have a=20 'driver.pci'. You could have a 'devclass.acpi/pci' and a 'devclass.pci/pci= '=20 though for class-wide things perhaps. Drivers are a much harder nut to cra= ck=20 given that they don't really have a sensible uniquifier. =2D-=20 John Baldwin <john@baldwin.cx> <>< http://www.baldwin.cx/~john/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402261722.42523.john>