Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2012 09:03:38 -0700
From:      mdf@FreeBSD.org
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@freebsd.org, Eitan Adler <eadler@freebsd.org>, svn-src-all@freebsd.org, Sergey Kandaurov <pluknet@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r236380 - head/sys/vm
Message-ID:  <CAMBSHm9O5Z5HLX-FaOT=e_4ot2JHiZD2mRuXLCgSm=68SRLA2g@mail.gmail.com>
In-Reply-To: <20120601175403.H1865@besplex.bde.org>
References:  <201206010442.q514gqqv084148@svn.freebsd.org> <CAE-mSOK=qyKbTwnKx_y5VmDNdYJG_K7R4j6565hWy09gEu_wZQ@mail.gmail.com> <20120601175403.H1865@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 1, 2012 at 2:14 AM, Bruce Evans <brde@optusnet.com.au> wrote:
>>> +SYSCTL_OID(_vm, OID_AUTO, swap_free,
>>> CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL, 0, sysctl_vm_swap_free, "Q",
>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 "Blocks of free swap storage.");
>
>
> Bug 9 is a style bug. =A0I didn't even know that the raw SYSCTL_OID() cou=
ld
> be misused like this. =A0The normal SYSCTL_PROC() is identical with
> SYSCTL_OID() except it checks that the access flags are not 0. =A0Few or =
no
> SYSCTL_FOO()s have no access flags, and this is not one. =A0It has rather
> excessive access flags (I think CTLFLAG_MPSAFE is unnecessary.

I wanted to correct this one point.  CTLFLAG_MPSAFE is helpful,
because its use prevents kern_sysctl from taking Giant before calling
the sysctl handler.  It's probably nearing the case, now, that any
sysctl *without* CTLFLAG_MPSAFE is incorrect, except perhaps for a few
that set/get text strings that don't want to roll their own
serialization.

Cheers,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMBSHm9O5Z5HLX-FaOT=e_4ot2JHiZD2mRuXLCgSm=68SRLA2g>