From owner-freebsd-arch@FreeBSD.ORG Thu Feb 26 14:21:33 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6123C16A4CE for ; Thu, 26 Feb 2004 14:21:33 -0800 (PST) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 294DB43D1F for ; Thu, 26 Feb 2004 14:21:33 -0800 (PST) (envelope-from john@baldwin.cx) Received: (qmail 1963 invoked from network); 26 Feb 2004 22:21:32 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 26 Feb 2004 22:21:32 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i1QMLI28052274; Thu, 26 Feb 2004 17:21:18 -0500 (EST) (envelope-from john@baldwin.cx) From: John Baldwin To: arch@FreeBSD.org Date: Thu, 26 Feb 2004 17:22:42 -0500 User-Agent: KMail/1.6 References: <20040226.130200.112722727.imp@bsdimp.com> In-Reply-To: <20040226.130200.112722727.imp@bsdimp.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200402261722.42523.john@baldwin.cx> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: des@des.no cc: rwatson@freebsd.org Subject: Re: per-device sysctls X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 22:21:33 -0000 On Thursday 26 February 2004 03:02 pm, M. Warner Losh wrote: > In message: > > des@des.no (Dag-Erling Sm=F8rgrav) writes: > : Robert Watson 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.. 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 <>< http://www.baldwin.cx/~john/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org