Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2014 01:18:11 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Andrey Chernov <ache@freebsd.org>
Cc:        svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   Re: svn commit: r269055 - stable/10/sys/kern
Message-ID:  <20140724221811.GW93733@kib.kiev.ua>
In-Reply-To: <53D17080.4010407@freebsd.org>
References:  <201407241043.s6OAhFoF061672@svn.freebsd.org> <53D15F14.9010606@freebsd.org> <20140724194820.GV93733@kib.kiev.ua> <53D17080.4010407@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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