From owner-cvs-src@FreeBSD.ORG Sun Apr 10 16:00:44 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF7BA16A4CF; Sun, 10 Apr 2005 16:00:44 +0000 (GMT) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22FA943D39; Sun, 10 Apr 2005 16:00:44 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])j3AG0VJu012816; Mon, 11 Apr 2005 02:00:31 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) j3AG0R0I027655; Mon, 11 Apr 2005 02:00:28 +1000 Date: Mon, 11 Apr 2005 02:00:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Sam Leffler In-Reply-To: <4256BF44.2000100@errno.com> Message-ID: <20050411013720.F54820@delplex.bde.org> References: <19677.1112980993@critter.freebsd.dk> <4256BF44.2000100@errno.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: cvs-src@FreeBSD.org cc: Poul-Henning Kamp cc: Gleb Smirnoff cc: cvs-all@FreeBSD.org cc: src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_mutex.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2005 16:00:44 -0000 On Fri, 8 Apr 2005, Sam Leffler wrote: > Poul-Henning Kamp wrote: >> In message <4256B3EF.5090702@errno.com>, Sam Leffler writes: >> >>> I agree with bde. One major distinction I've noticed between Linux and >>> BSD systems is that Linux uses sysctls (aka /proc) in lieu of user-mode >>> tools that retrieve and format data. While this is a reasonable approach >>> when you're distributing only a kernel that's not the case here. For >>> debug info I can buy doing it (e.g. single user and no apps >> >>> from src/tools), but otherwise we're just adding stuff to the kernel >> >>> that belongs in apps. >> >> The reason I disagree is that the amount of code it takes to convert >> the data to an export format and the overhead of having a program in >> userspace format it into text is ridiculous compared to just formatting >> things in the kernel to begin with. > > My experience is the opposite. Mine too. In the kernel, as in userland, it takes almost no code, or at least very simple code, to [s]printf the data once you have assembled it and decided the format. Deciding the format can take a lot of code, but the kernel cannot do complicated formats that handles the user's screen size, etc., so the formatting part is simpler than possible in the kernel. Then userland has to do extra work to parse the poorly formatted unstructured data if it wants to present it in a different or better way, so doing everything in the kernel only takes less code if no applications do this. >> And besides, a formatted sysctl has no binary compatibility issues at >> all. I like that too. > > Sure, that's the downside; you need to design binary protocols with care > (this is a protocol after all). The same is true for ASCII protocols. Unstructured ones are hard to change for both. You might be able to change whitespace in an undocumented unstructured ASCII "protocol" without affecting userland parsers, but you can't add an extra column to tabular output without breaking things. Bruce