Date: Wed, 8 Jan 2014 20:59:12 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Andriy Gapon <avg@FreeBSD.org> Cc: Adrian Chadd <adrian@FreeBSD.org>, "freebsd-arch@freebsd.org" <freebsd-arch@FreeBSD.org> Subject: Re: Acquiring a lock on the same CPU that holds it - what can be done? Message-ID: <20140108185912.GU59496@kib.kiev.ua> In-Reply-To: <52CD7D07.2010608@FreeBSD.org> References: <CAJ-Vmok-AJkz0THu72ThTdRhO2h1CnHwffq=cFZGZkbC=cWJZA@mail.gmail.com> <52CD7D07.2010608@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--BrbyRrLlz6sbpz/w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 08, 2014 at 06:29:59PM +0200, Andriy Gapon wrote: >=20 > I am sure that the following approach was suggested before, but I can not= find > any references now. > So, the idea is to auto-associate a priority with a lock. Every time a p= riority > lending would kick in we would record the priority in the lock. The next= time a > thread with a lower priority acquires that lock we would automatically bo= ost the > thread to the recorded priority until it releases the lock. This should = prevent > the situation that you've described where a higher priority thread preemp= ts a > lower priority thread just to discover that it holds a required lock and > priority lending is required before relinquishing a CPU to the preempted = thread. Isn't this exactly the mechanism offered by turnstiles, and used by non-sleepable locks ? >=20 > I am sure that there could be downsides to this approach. > --=20 > Andriy Gapon > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" --BrbyRrLlz6sbpz/w Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSzZ//AAoJEJDCuSvBvK1BRJoP/3bsg5yJXSPTSyZpK1NE8usg pQXKqrt8qOkFJhm20XLE+35w7OYqIa4dsCDYch87Ite1jwn+r2zUEUSMxnJV/N2P 626dUPXws+sWXLmVG2bQAsLvEDzKuGI5HM5vRGWxi6/viYlJs9BkaC/lqaMK459s JdlDtKvYCOU7g2DJoLk5u6nId2RTq/+ahvGXvpTzFNTRN+GRd5ZUwuHVFqRyRTUS RrVcEN9D43lY2SLjtzAWaUNNLQ6QhLTStlQJQ7cCoU0/uC+q4zdPZnEu2cqR7dhD 4fInSHcDGyJC6nnl2jU0/KL9xTEFrvQrQLvBUD8TsztZDbI/qcFWneMgUgbfRAXI cINUon/shmL0Jvfz+m9eASWAx8r7hq6XS3yfSlAFHGVRSh3XTafvuRZxmAC8O/oZ Pihqf86RgsoZORe+N0JNGuDZ2Th5RzQqPIP7fgvckXSsZu94z/m4zpv2lcw1K1AL m8QLiWLpxGH0/FyRZfLzrdoIIeZrFcyVIc7SHDr3SFt1I9Gs+XoO99IaavZ24gj5 D6imJTgSYYA8jNKx7fyJRF9jycRtfOjOz417pQOzUxD7lJ7aDQnONEPMfVexg43s jJi2il/TkIZFb/0bBOq1DVhgwG5WCy6CxbejFD4ekTF6nJQeiDPdYQMBgk3nT/Eq 536pSHpjr6Q+fM1ulIOg =LvAL -----END PGP SIGNATURE----- --BrbyRrLlz6sbpz/w--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140108185912.GU59496>