From owner-svn-src-head@FreeBSD.ORG Wed Jul 29 05:30:39 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A35B106566C; Wed, 29 Jul 2009 05:30:39 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4808FC1B; Wed, 29 Jul 2009 05:30:38 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 074F645C99; Wed, 29 Jul 2009 07:30:37 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6457A45685; Wed, 29 Jul 2009 07:30:31 +0200 (CEST) Date: Wed, 29 Jul 2009 07:30:56 +0200 From: Pawel Jakub Dawidek To: Randall Stewart Message-ID: <20090729053056.GC3550@garage.freebsd.pl> References: <200907281409.n6SE971u034585@svn.freebsd.org> <20090729051016.GB3550@garage.freebsd.pl> <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qjNfmADvan18RZcF" Content-Disposition: inline In-Reply-To: <354E0657-DC37-4493-8E17-D09B257B5A28@lakerest.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195918 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 29 Jul 2009 05:30:39 -0000 --qjNfmADvan18RZcF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 29, 2009 at 01:23:24AM -0400, Randall Stewart wrote: > >Instead of using additional argument to the sctp_add_to_readq() > >function, wouldn't it be sufficient to just check with mtx_owned(9) if > >the lock is already held? >=20 > Hmm... I suppose one could go that way... but traditionally upper code = =20 > as > told the lower code that it holds/does not hold the lock. This is true > in quite a few other functions... We can find examples of both behaviours in many places, that's true. The reason to keep additional argument is that once you decide to move to read-write locks it might not be reliable to check if read-lock is already held by the current thread. All in all both solutions work, my observation was only that diff could be significantly reduced by using mtx_owned(9), nothing major. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --qjNfmADvan18RZcF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKb96QForvXbEpPzQRAojyAJ9tCSLHEaovLIDI5QylnxwIl0VKvACg+Cty AG6WF5UCdcAEE6i+01J2NSs= =q126 -----END PGP SIGNATURE----- --qjNfmADvan18RZcF--