Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2019 13:39:59 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Mark Johnston <markj@freebsd.org>
Cc:        Alan Somers <asomers@freebsd.org>, src-committers <src-committers@freebsd.org>,  svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r348737 - head/sys/kern
Message-ID:  <CANCZdfqtWVUdSCWYfuE%2BG_iamLfAZgJJ1HPE37RevUwFk%2B-1yg@mail.gmail.com>
In-Reply-To: <20190606183552.GD3015@raichu>
References:  <201906061504.x56F4odw034764@repo.freebsd.org> <201906061735.x56HZGIJ058845@gndrsh.dnsmgr.net> <CAOtMX2iQ=Q9tR2MviXQDRqs_UNW6gQq=BGiDpNwXbpWjG%2BH7CQ@mail.gmail.com> <c6d9a869-d678-212b-0bc6-d0046f892e76@FreeBSD.org> <CAOtMX2jvfnXx35DoV3JBGeVcm%2BDtbd4HWmqFBSNNEbGO4eBa9Q@mail.gmail.com> <20190606183552.GD3015@raichu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 6, 2019, 12:36 PM Mark Johnston <markj@freebsd.org> wrote:

> On Thu, Jun 06, 2019 at 12:04:52PM -0600, Alan Somers wrote:
> > On Thu, Jun 6, 2019 at 12:01 PM John Baldwin <jhb@freebsd.org> wrote:
> > >
> > > On 6/6/19 10:39 AM, Alan Somers wrote:
> > > > On Thu, Jun 6, 2019 at 11:35 AM Rodney W. Grimes
> > > > <freebsd@gndrsh.dnsmgr.net> 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.
>
> +1 to making it unconditional.  We already have lots of debugging
> sysctls enabled in !INVARIANTS kernels, and these sorts of things end up
> being handy in unexpected ways.  For a long time I've carried a patch
> which unconditionally compiles debug.vm_lowmem because I kept having to
> recompile to get it.
>


Unconditional. I strongly disagree that things useful for diagnosis of a
problem don't belong in the kernel. It's not the 80s or 90s where a few
bytes would help. Having run a huge network of machines that have weird
random stuff happen has convinced me the more tools to debug the better.
Especially for random stuff that goes away when I reboot the debug kernel.

Warner

>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqtWVUdSCWYfuE%2BG_iamLfAZgJJ1HPE37RevUwFk%2B-1yg>