From owner-freebsd-arch Mon May 8 1:12:51 2000 Delivered-To: freebsd-arch@freebsd.org Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by hub.freebsd.org (Postfix) with ESMTP id 7D9C637B626 for ; Mon, 8 May 2000 01:12:39 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id RAA68371; Mon, 8 May 2000 17:41:29 +0930 (CST) Date: Mon, 8 May 2000 17:41:27 +0930 From: Greg Lehey To: Poul-Henning Kamp Cc: FreeBSD-arch@FreeBSD.ORG Subject: Re: Tidiness or kernel bloat? (was: Support for bootable Vinum file systems: please review) Message-ID: <20000508174126.U61921@freebie.lemis.com> References: <20000508083331.A61488@freebie.lemis.com> <16522.957772628@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <16522.957772628@critter.freebsd.dk> Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Monday, 8 May 2000 at 9:57:08 +0200, Poul-Henning Kamp wrote: > In message <20000508083331.A61488@freebie.lemis.com>, Greg Lehey writes: > >>>> Can you make an alternative suggestion? >>> >>>>>>> The right way to do it is probably to link the "struct disk"s >>>>>>> registered by the drivers with disk_creat() into a list which can >>>>>>> be searched. >> >> You're not very strong on reasoning here. You don't answer my >> question: >> >>>>>> Why should we maintain two lists, just because one is primarily >>>>>> intended for statistics? > > Because one of them is *only* intended to care about statistics. That was the intention. If you find it's useful for something else as well, what's the problem? > Pretty soon you might see devstat track statistics for all logical > disk, ie: ad0s1a, ad0s1b, ad0s1, ad0, and you may see it integrated > more into the disk mini-layer. None of these changes would affect > other users of devstat (except provide more detail) but all of > sudden vinum would need magic fixes to only look for whatever types > of devices vinum wants to look for. It does that now. Look at the patch. >> Your only objection appears to be: >> >>>>> No, this is an objection to opening up devstat that way. >> >> Devstat is already available in userland. What more opening up are >> you talking about? You approach appears to only add to kernel bloat. > > 1. You are not trying to access it from userland. Should I be penalized for that? In general, the kernel should have access to everything that userland has access to. Would you object to this if I were looking for statistics instead? > 2. The userland access is a well-defined API. I'm using the same data structures. What more interface do you want? > 3. You want to open the implementation to your can grovel around in > the entrails of devstats implementation. This is very much a matter of definition. > If you insist on this gross hack, the very least you could do was to > add a couple of functions to the devstat code rather than pull all > the internals into daylight. Have you looked at the code? These "internals" are exactly the data that we hand to userland. I could, of course, write a devstat function which makes a copy of the data, the way it hands it to userland, but what's the point of that? And why should passing a different structure be less untidy, just because it was specially built for this purpose? This smells of NIH. While I still disagree with your interpretation, Justin made a valid point: the real way to do this is with a callback. How about a compromise: we leave the code the way it is for now. Later, when you implement the callbacks you've been talking about, I'll modify things to use them instead, completely removing any reference to devstat. OK? Greg -- Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message