From owner-svn-src-all@FreeBSD.ORG Thu Jul 24 22:18:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 393D7363; Thu, 24 Jul 2014 22:18:18 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 CCF522ED7; Thu, 24 Jul 2014 22:18:17 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s6OMIBsr072301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Jul 2014 01:18:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s6OMIBsr072301 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s6OMIB3S072300; Fri, 25 Jul 2014 01:18:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Jul 2014 01:18:11 +0300 From: Konstantin Belousov To: Andrey Chernov Subject: Re: svn commit: r269055 - stable/10/sys/kern Message-ID: <20140724221811.GW93733@kib.kiev.ua> References: <201407241043.s6OAhFoF061672@svn.freebsd.org> <53D15F14.9010606@freebsd.org> <20140724194820.GV93733@kib.kiev.ua> <53D17080.4010407@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9Cxisu/QTvVbpxiQ" Content-Disposition: inline In-Reply-To: <53D17080.4010407@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2014 22:18:18 -0000 --9Cxisu/QTvVbpxiQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 25, 2014 at 12:45:52AM +0400, Andrey Chernov wrote: > On 24.07.2014 23:48, Konstantin Belousov wrote: > > On Thu, Jul 24, 2014 at 11:31:32PM +0400, Andrey Chernov wrote: > >> On 24.07.2014 14:43, Konstantin Belousov wrote: > >>> Author: kib > >>> Date: Thu Jul 24 10:43:15 2014 > >>> New Revision: 269055 > >>> URL: http://svnweb.freebsd.org/changeset/base/269055 > >>> > >>> Log: > >>> MFC r268384: > >>> When the lock was stolen from us, retry the whole lock sequence in = kernel, > >>> instead of returning EINTR. > >> > >> Does it make dead loop possible? > >=20 > > What is dead loop ? >=20 > I mean infinite retries with returning EDOOFUS each time and goto > retry_setlock; again. The fcntl(F_SETLKW) behaviour requires blocking until the lock can be obtained. I think (I remember this, but I did not re-readed the code now to confirm my memory) is that if the race does not happen then the advisory locks are fair, i.e. the lock requests are granted in the order of apperance. The race causes the lock requestor to re-enter the queue from the start. On the other hand, the race which causes the problems there is rare and probably impossible to utilize in reliable manner. That said, I would be interested in seeing proof-of-concept lifelock code, but I very much doubt that it can be written. Also, I think (same disclaimer) that the race can only happen with mt process among its own threads. >=20 > > Do you see a problem on your machine ? >=20 > No, just by looking at the commit message. >=20 > --=20 > http://ache.vniz.net/ --9Cxisu/QTvVbpxiQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT0YYjAAoJEJDCuSvBvK1BVjMQAIiFErpqrtUrXae4LhhkIOYG DEovAkkKeLeTKDT6FO5nXb09gF5a8tON+DWwS07tYQjY760yIqCQaut+NtSFXBxH Y5B02joR8O7tGg7t/auniHA7GW0c29Xr5OCOLTrWObFhUKnbrO8QU7xFDd3tyPF9 ysLiUc0UIhgLfaZRtd0A9CEZUysWWGL0b6MIZBsgXwR99ksM4INyTFEdCdUEigpC 56vfW6NZO5pEPNpAoITRWV0Cy2Swhfjj7evrRfClhtuQqZeL5QxkeKwfcbj0Up5J /GZN5NluE+ghafHhByOnwsM+rKTRoqRVKuqSmcpP8dEYQpoYxXkDpWKjrU4TXzsR vjyqRvAV6C7R2Bpp3CUIKuxonwIfg/dEYx7NxYB85dItbpxdyXgXwhexKrNQRNOm LGNIyE9zPH9aCoUQMrztx/WYJpgjl7cBg2/0y+v0M/qG6h0xqcVIYl4U8rbNcCyM sYii6RsAlUrDVOo6r+6HqbBpV8fW3Wt7GMK61h8ALPTm1hhDYn5g61X+aO2cU3z1 9pGC3DlUrHanjoYE7gqymDgM+6bKds0DzGJUj1cEDwqpBw9Fh/L5jcR6dyruR2/R iykt40Vc8U0/REUEMJ7rB9iiWQOH05Ccwzwn7ZefWYw27W2mRSZsXEFomSmCAW/t l2+vSehkqKNFJwCjqxlz =faez -----END PGP SIGNATURE----- --9Cxisu/QTvVbpxiQ--