From owner-svn-src-head@freebsd.org Thu Jun 6 20:02:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A8A715BEB1D; Thu, 6 Jun 2019 20:02:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4BCF85C41; Thu, 6 Jun 2019 20:02:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id D9B4BEFC5; Thu, 6 Jun 2019 20:02:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348737 - head/sys/kern To: Ian Lepore , Alan Somers Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head References: <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> <62763406801d603b0dda6ff4754bf7e9b714a8e0.camel@freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+la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gIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 6 Jun 2019 13:02:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <62763406801d603b0dda6ff4754bf7e9b714a8e0.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4BCF85C41 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 20:02:14 -0000 On 6/6/19 11:21 AM, Ian Lepore wrote: > On Thu, 2019-06-06 at 12:04 -0600, Alan Somers wrote: >> On Thu, Jun 6, 2019 at 12:01 PM John Baldwin wrote: >>> >>> On 6/6/19 10:39 AM, Alan Somers wrote: >>>> On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes >>>> wrote: >>>>> >>>>>> Author: asomers >>>>>> Date: Thu Jun 6 15:04:50 2019 >>>>>> New Revision: 348737 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/348737 >>>>>> >>>>>> Log: >>>>>> Add a testing facility to manually reclaim a vnode >>>>>> >>>>>> Add the debug.try_reclaim_vnode sysctl. When a pathname is >>>>>> written to it, it >>>>>> will be reclaimed, as long as it isn't already or doomed. >>>>>> The purpose is to >>>>>> gain test coverage for vnode reclamation, which is >>>>>> otherwise hard to >>>>>> achieve. >>>>>> >>>>>> Add the debug.ftry_reclaim_vnode sysctl. It does the same >>>>>> thing, except >>>>>> that its argument is a file descriptor instead of a >>>>>> pathname. >>>>> >>>>> Should not this all be wrapped in some #ifdef or other >>>>> protection, >>>>> is it really a good idea to have this on every single box >>>>> running >>>>> FreeBSD? >>>> >>>> I initially thought so too, but kib thought that it could be >>>> useful >>>> for debugging problems in the field. The potential downside is >>>> limited, because only root can write to the sysctls, and the >>>> worse-case damage is similar to a "umount -f". >>> >>> A compromise might be to stick this in a kernel module instead of >>> in the >>> base kernel. You could still kldload it in the field for debugging >>> but >>> not necessarily have it directly available out of the box. >>> >>> -- >>> John Baldwin >> >> If we already had such a module, it would make sense to put these >> sysctls in there. But I don't want to create an entire module for >> just a few dozen LOC. Nor do I want to mediate a bike shed. So >> let's >> vote. kib already registered a vote for making them available all of >> the time. rgrimes voted to guard them by INVARIANTS. Anybody else >> who cares can reply to this thread. I'll count the votes in 24 >> hours. >> -Alan >> > > If our new policy is to remove sysctls that aren't used often "because > something bad might happen" (without any requirement for the complainer > to elaborate on just what might happen or why it's so much worse than > the damage a root user could do with any other sysctl), I think several > people could be employed full time doing that removal work. Or we > could all just get on with doing some real work. What I find a bit different about this case is when it's a debugging knob. For that sort of thing, kernel modules are a pretty decent way to inject new functionality into the system that is rarely needed. A while back I had a problem with resume on a laptop seemingly not unsticking all of the processes that had been paused via stop_all and had a hacky kernel module with a magic sysctl that would try to unstick things. That worked better as a module that I only loaded if needed. Similar for a hacky kernel module at a previous job (killsmi.ko) that would write to the appropriate ICH register to disable all SMIs when loaded, etc. -- John Baldwin