Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 2015 09:42:54 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r278760 - head/sys/kern
Message-ID:  <4509701.vaGfDQNhqC@ralph.baldwin.cx>
In-Reply-To: <20150214182109.GC18597@dft-labs.eu>
References:  <201502141702.t1EH2pVa059259@svn.freebsd.org> <20150214182109.GC18597@dft-labs.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, February 14, 2015 07:21:10 PM Mateusz Guzik wrote:
> On Sat, Feb 14, 2015 at 05:02:51PM +0000, John Baldwin wrote:
> > +SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created,
> > +    0, "Number of vnodes created by getnewvnode");
> > +
> 
> [..]
> 
> > +static u_long recycles_count;
> > +SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0,
> > +    "Number of vnodes recycled to avoid exceding kern.maxvnodes");
> > +
> 
> CTLFLAG_MPSAFE?

#define	SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr)	\
	SYSCTL_OID(parent, nbr, name,					\
	    CTLTYPE_ULONG | CTLFLAG_MPSAFE | (access),			\
	    ptr, val, sysctl_handle_long, "LU", descr);			\
	CTASSERT((((access) & CTLTYPE) == 0 ||				\
	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_ULONG) &&	\
	    sizeof(unsigned long) == sizeof(*(ptr)))

All the trivial sysctls already include CTLFLAG_MPSAFE so that I didn't have 
to go spray that flag all over the tree.  Only SYSCTL_PROC nodes need to be 
explicitly tagged.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4509701.vaGfDQNhqC>