Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2011 12:04:08 +0000
From:      "Robert N. M. Watson" <rwatson@freebsd.org>
To:        mdf@FreeBSD.org
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r217830 - head/share/man/man9
Message-ID:  <4BA17961-83D4-4B91-88CF-82FE5502D8E8@freebsd.org>
In-Reply-To: <AANLkTinX5woy2kVo-gui9v2WQ=2LbTviJAa8aK9ET_10@mail.gmail.com>
References:  <201101251739.p0PHdqKX044842@svn.freebsd.org> <alpine.BSF.2.00.1101260929430.44308@fledge.watson.org> <AANLkTimqyPYah5=yWHVxf3Us4=cBYKGkb0oyAE%2B7R-%2Bt@mail.gmail.com> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <AANLkTimn0te0NKR%2BusYC6CzxUVVaP%2BnpZKstsw1mWC7o@mail.gmail.com> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> <AANLkTim3M7GzNmV-M9%2BPhtVRv5EK3u9AsPz=YaESv7y5@mail.gmail.com> <D7364835-5441-4C0E-8CA0-A82C2F99441A@freebsd.org> <AANLkTinX5woy2kVo-gui9v2WQ=2LbTviJAa8aK9ET_10@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BA17961-83D4-4B91-88CF-82FE5502D8E8>