Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Dec 2014 13:07:47 +0300
From:      Chagin Dmitry <dchagin@freebsd.org>
To:        Benjamin Kaduk <bjk@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys
Message-ID:  <20141214100747.GA7216@dchagin.static.corbina.net>
In-Reply-To: <alpine.GSO.1.10.1412132204280.23489@multics.mit.edu>
References:  <201412132100.sBDL0BvR094009@svn.freebsd.org> <CAJ5_RoCnMNEEa86besbhfKTxf-wOhwBy%2BjktLB7%2Bod=zkSQ6Aw@mail.gmail.com> <20141213213111.GA2070@dchagin.static.corbina.net> <alpine.GSO.1.10.1412132204280.23489@multics.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Dec 13, 2014 at 10:06:06PM -0500, Benjamin Kaduk wrote:
> On Sat, 13 Dec 2014, Chagin Dmitry wrote:
>=20
> > > Can you please say a bit more about why this is desired and what it w=
ill be
> > > used for?
> > >
> > If the kernel has been compiled with INVARIANTS _init() will assert tha=
t the
> > lock has not been initialized multiple times. _NEW flag is needed to sk=
ip this.
>=20
> Yes, I have run into that assertion a few times; it helped me fix bugs in
> my code.
>=20
> > as _init() does expect you to zero lock first.
> > it should be used carefully, when you are sure its safe,
> > to avoid bzero'ing lock struct. ugh
>=20
> I guess I'm still confused as why skipping the zeroing is useful.
> Wouldn't it be a good practice to always zero?
useful? no
>=20
>=20
> Do you have any specific places in mind where you want to use this
> functionality?  That might help me understand.
>=20
sure, next commit

--=20
Have fun!
chd



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