From owner-freebsd-arch Sun Jul 14 3:46:11 2002 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 1F7C237B400 for ; Sun, 14 Jul 2002 03:46:07 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A474C43E31 for ; Sun, 14 Jul 2002 03:46:06 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g6EAjvwr020972; Sun, 14 Jul 2002 03:46:01 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200207141046.g6EAjvwr020972@gw.catspoiler.org> Date: Sun, 14 Jul 2002 03:45:57 -0700 (PDT) From: Don Lewis Subject: Re: wiring the sysctl output buffer To: phk@critter.freebsd.dk Cc: arch@FreeBSD.ORG In-Reply-To: <62432.1026642470@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 14 Jul, Poul-Henning Kamp wrote: > In message <200207141020.g6EAK4wr020922@gw.catspoiler.org>, Don Lewis writes: >>On 14 Jul, Poul-Henning Kamp wrote: >>> You may also want to restrict the amount of buffer you pin >>> if I hand the kernel a 2G buffer for a 4 byte sysctl integer >>> you wouldn't want to pin it all. >> >>Yeah, that could be bad, but the SYSCTL_OUT() in the current API pins >>the whole user supplied buffer on the first call. My new entry point >>does the same thing, but allows the caller to do this potentially >>blocking operation earlier. > > I know, but that also affords an opportunity to be smarter (ie: letting > the entry point say "I need this much storage"). I like this idea, though we'd want to move the new interface to the recommended list. There is also the problem keeping track of how much memory we wired. The current sysctl exit code unwires the entire user supplied buffer. If we only wire a portion, then we would need to add a member to the sysctl_req structure to record how much was wired so that we could unwire that amount on exit. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message