From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:14:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDCE2106567A; Wed, 26 Jan 2011 21:14:16 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 885268FC12; Wed, 26 Jan 2011 21:14:16 +0000 (UTC) Received: by iwn39 with SMTP id 39so1345078iwn.13 for ; Wed, 26 Jan 2011 13:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HCoyLqyf78rIv8Ma4luGZLzFJbW56EGdBUbf+B21NXw=; b=FKJEn9u4MHLOhZCiv/ayVh1Y/6KBeiQDPVxT3w7Z5koambT2ICo6kNuIzVwJ++EkA4 r+gxa6LYJ6lQQxa/GNn91atO/Krtx3/11PMz8qyTnCYnoVnMUW7UH6mdDAT6DOfGzA1+ F8XnYf/kr+QEe3m3x3nWIq76UJddAxmE0mqYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=cTzrjQ1slk5p8Hjsk44ume/b9LajOs0mAXAp9wBMrL85fiUnQ+DHMfHVbvUESMhKQA hiHTPNSMDlaileJmASQlGC5IF4p3R19muJF/tMfwYfA4Vj73C4IXxo56LcZZoHtCe+Gg nYemf45C5CguwdLnTlHyBDDCs+NanQz3J7IxM= MIME-Version: 1.0 Received: by 10.231.40.3 with SMTP id i3mr8906417ibe.129.1296076455557; Wed, 26 Jan 2011 13:14:15 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Wed, 26 Jan 2011 13:14:15 -0800 (PST) In-Reply-To: <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> Date: Wed, 26 Jan 2011 13:14:15 -0800 X-Google-Sender-Auth: ro2v3qqaOvl2H7gKMMjh9KPcToc Message-ID: From: mdf@FreeBSD.org To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:14:17 -0000 On Wed, Jan 26, 2011 at 1:10 PM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 18:29, mdf@FreeBSD.org wrote: > >>> I suppose an important question is now often we see this actually faili= ng >> >> I don't believe we've ever seen a memory failure relating to sysctls >> at Isilon and we've been using the equivalent of this code for a few >> years. =A0Our machines aren't low memory but they are under memory >> pressure sometimes. > > The kinds of cases I worry about are things like the tcp connection monit= oring sysctls. Most systems have a dozen, hundred, or a thousand connection= s. Some have half a million or a million. If we switched to requiring wirin= g every page needed to store that list, it would do terrible things to the = system. So really what I have in mind is: either we handle cases like that = well, or we put in a clear warning and have obvious failure modes to catch = the cases where it didn't work out. In practice, I think we would not want = to switch the tcpcb/inpcb sysctl for this reason, but as people say "ah, th= is is convenient" we need to make sure it's handled well, and easy to debug= problems when they do arise. > But I think that problem exists today using sysctl for output, since it's non-iterative. In fact, it's often worse today, because in addition to the user-space buffer that needs to be large enough to hold the output, the kernel needs to malloc(9) a buffer to hold it before doing the one SYSCTL_OUT at the end that most routines I've seen use. For situations like this where there is a lot of output but it doesn't need to be serialized by a lock held across the whole data fetch, then yes, using sbuf_new_for_sysctl() would wire more memory. Thanks, matthew