From owner-freebsd-arch Mon Jan 15 20:23:54 2001 Delivered-To: freebsd-arch@freebsd.org Received: from beastie.mckusick.com (beastie.mckusick.com [209.31.233.184]) by hub.freebsd.org (Postfix) with ESMTP id D8C8A37B401 for ; Mon, 15 Jan 2001 20:23:36 -0800 (PST) Received: from beastie.mckusick.com (localhost [127.0.0.1]) by beastie.mckusick.com (8.9.3/8.9.3) with ESMTP id PAA22257; Mon, 15 Jan 2001 15:45:35 -0800 (PST) (envelope-from mckusick@beastie.mckusick.com) Message-Id: <200101152345.PAA22257@beastie.mckusick.com> To: Alfred Perlstein Subject: Re: dynamic vs static sysctls? Cc: arch@FreeBSD.ORG In-Reply-To: Your message of "Mon, 15 Jan 2001 10:37:57 PST." <20010115103757.B7240@fw.wintelcom.net> Date: Mon, 15 Jan 2001 15:45:35 -0800 From: Kirk McKusick Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Date: Mon, 15 Jan 2001 10:37:57 -0800 From: Alfred Perlstein To: Hajimu UMEMOTO Cc: arch@FreeBSD.ORG Subject: dynamic vs static sysctls? [moved to -arch] ... No one I know wants to use sysctl instead of getsysctlbyname afaik, however, I would like to know if my opinions are the what we're aiming for. ... -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." I have an example where sysctl is still useful. In my work on a background version of fsck, I have used sysctl to allow me to pass information into the kernel that I want to have updated in the filesystem. In the case of lost blocks, there may be hundreds or even thousands of blocks that need to be put back into the bit maps. Each non-contiguous block is passed in separately which results in hundreds or thousands of sysctl calls. I want to do one call to sysctlnametomib (a new, but obviously trivial function) to return the numeric mib, and then use that mib on all the subsequent sysctl calls. That dramatically cuts down on the time it takes to return the blocks since I do not have to translate the same name repeatedly (which takes far longer than the block release itself). I would think that this might be an issue for any application that uses sysctl to get/set the same information repeatedly. Kirk McKusick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message