From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 12:04:12 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 34BB8106566C; Thu, 27 Jan 2011 12:04:12 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 087BF8FC16; Thu, 27 Jan 2011 12:04:12 +0000 (UTC) Received: from [192.168.2.112] (host109-157-98-53.range109-157.btcentralplus.com [109.157.98.53]) by cyrus.watson.org (Postfix) with ESMTPSA id 53B3046B3B; Thu, 27 Jan 2011 07:04:10 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Thu, 27 Jan 2011 12:04:08 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4BA17961-83D4-4B91-88CF-82FE5502D8E8@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1082) 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: Thu, 27 Jan 2011 12:04:12 -0000 On 26 Jan 2011, at 23:41, mdf@FreeBSD.org wrote: > Upon further consideration, I don't think sbuf_new_for_sysctl() should > be doing the wire. Whether the buffer needs to be wired or not is up > to the implementation of the individual sysctl; *most* of them will be > holding a lock when doing sbuf_print, but there's no guarantee. It's > simpler to just leave this in the hands of the implementor, and it > also enables better error reporting. One pondering: normally, it's nice if functions that may sleep = unconditionally trigger a WITNESS sleep warning even if they don't = actually sleep this time (although conditioned on arguments: if you pass = M_WAITOK to malloc, you always get the warning even if malloc doesn't = sleep, whereas if you pass M_NOWAIT it doesn't). I'm wondering how we = could do something similar here -- the problem is that sysctl copy = routines don't currently know if a page is wired or not, and therefore = whether they could sleep or not. I wonder, with a witness kernel, how = expensive it would be to have witness check for each range it was = copying in/out of, whether the page was wired (by asking VM = presumably)... There might also be lock order issues with that query. One way to handle this would be to have the sbuf sysctl setup pass in a = "wired" flag, or some other indication of wiredness, and then that could = be saved with the sbuf -- when sbuf_printf and friends are called, and a = non-wired sysctl has been set up, then the witness warning fires. Robert=