From owner-svn-src-head@FreeBSD.ORG Sun Dec 14 03:06:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C506918; Sun, 14 Dec 2014 03:06:20 +0000 (UTC) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72902E2C; Sun, 14 Dec 2014 03:06:18 +0000 (UTC) X-AuditID: 1209190c-f79e46d000000eb2-01-548cfea3d2f1 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 76.EE.03762.3AEFC845; Sat, 13 Dec 2014 22:06:11 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id sBE36Atr029372; Sat, 13 Dec 2014 22:06:10 -0500 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id sBE367SF011495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 13 Dec 2014 22:06:09 -0500 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id sBE367XM005334; Sat, 13 Dec 2014 22:06:07 -0500 (EST) Date: Sat, 13 Dec 2014 22:06:06 -0500 (EST) From: Benjamin Kaduk X-X-Sender: kaduk@multics.mit.edu To: Chagin Dmitry Subject: Re: svn commit: r275751 - in head: share/man/man9 sys/kern sys/sys In-Reply-To: <20141213213111.GA2070@dchagin.static.corbina.net> Message-ID: References: <201412132100.sBDL0BvR094009@svn.freebsd.org> <20141213213111.GA2070@dchagin.static.corbina.net> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmleLIzCtJLcpLzFFi42IR4hRV1l38ryfE4M1LQYvTs1+yWfxpn8Ji 8WfTQlaLpi8LmBxYPGZ8ms8SwBjFZZOSmpNZllqkb5fAldHT8I6tYBFbxbR7h9gaGF+wdDFy ckgImEj8/XSPGcIWk7hwbz1bFyMXh5DAYiaJns872CGcjYwSL99ch3IOMUmcXXcdqqyBUeLS 9MesXYwcHCwC2hKHOtlARrEJqEk83tvMCjFWUWLzqUlgK0QE1CVuv/rICGIzC+xmlNh0zBTE Fhbwljj2eRdYL6eAvcSR96/BbF4BR4nbJ2BOArpi1dst7CAJUQEdidX7p7BAFAlKnJz5hAVi qJbE8unbWCYwCs1CkpqFJLWAkWkVo2xKbpVubmJmTnFqsm5xcmJeXmqRrqFebmaJXmpK6SZG cDhL8uxgfHNQ6RCjAAejEg+vRW93iBBrYllxZe4hRkkOJiVR3opHPSFCfEn5KZUZicUZ8UWl OanFhxglOJiVRHj7vgPleFMSK6tSi/JhUtIcLErivJt+8IUICaQnlqRmp6YWpBbBZGU4OJQk eJf9BWoULEpNT61Iy8wpQUgzcXCCDOcBGr4OpIa3uCAxtzgzHSJ/ilGXY0H7/plMQix5+Xmp UuK8S0GKBECKMkrz4ObA0tArRnGgt4R5T4BU8QBTGNykV0BLmICWXGYEW1KSiJCSamBc11xo nr1zz7ODH6L5luwyX2kb8z1HrdpbuNfWpORg5PEaR969rXfmZGc8mshTmbNGvOGIK/NetW89 6+1cPz5U2buJ5W2gov2t7c7tXw9lJBgbMWzKc9TYcsRFSPCL+WrWnfy8cZzhcUv+Bi/18965 Zo6IivSFYAubI4u2XJ3Pb11omOgtPk+JpTgj0VCLuag4EQDMmB2MHgMAAA== Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sun, 14 Dec 2014 03:06:20 -0000 On Sat, 13 Dec 2014, Chagin Dmitry wrote: > > Can you please say a bit more about why this is desired and what it will be > > used for? > > > If the kernel has been compiled with INVARIANTS _init() will assert that the > lock has not been initialized multiple times. _NEW flag is needed to skip this. Yes, I have run into that assertion a few times; it helped me fix bugs in my code. > 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 I guess I'm still confused as why skipping the zeroing is useful. Wouldn't it be a good practice to always zero? Do you have any specific places in mind where you want to use this functionality? That might help me understand. Thanks, Ben