From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11573 Path: news.gmane.org!.POSTED!not-for-mail From: Jens Gustedt Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 4/8] determine the existence of private futexes at the first thread creation Date: Fri, 23 Jun 2017 19:16:56 +0200 Organization: inria.fr Message-ID: <20170623191656.4450f2f5@inria.fr> References: <20170623170535.GM1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/_385sTT4L7ATlSsR/dC_3UX"; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1498238240 26889 195.159.176.226 (23 Jun 2017 17:17:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Jun 2017 17:17:20 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-11586-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 23 19:17:11 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dOSCh-0006Ny-HI for gllmg-musl@m.gmane.org; Fri, 23 Jun 2017 19:17:07 +0200 Original-Received: (qmail 26468 invoked by uid 550); 23 Jun 2017 17:17:09 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 26447 invoked from network); 23 Jun 2017 17:17:09 -0000 X-IronPort-AV: E=Sophos;i="5.39,379,1493676000"; d="scan'208";a="280392210" In-Reply-To: <20170623170535.GM1627@brightrain.aerifal.cx> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAACRQTFRFERslNjAsLTE9Ok9wUk9TaUs8iWhSrYZkj42Rz6aD3sGZ Xref: news.gmane.org gmane.linux.lib.musl.general:11573 Archived-At: --Sig_/_385sTT4L7ATlSsR/dC_3UX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello Rich, On Fri, 23 Jun 2017 13:05:35 -0400 Rich Felker wrote: > On Tue, Jun 20, 2017 at 10:35:28PM +0200, Jens Gustedt wrote: > > The current strategie to deal with kernels that don't implement > > private futexes is to > >=20 > > - test if the call works with FUTEX_PRIVATE > > - fallback to a call without if it doesn't > >=20 > > This forces an overhead for both sides, Linux'es with and without > > private futexes. For those with, it adds a superflouous branch > > instruction to all calls. For those without, it add the whole call > > overhead of a syscall. =20 >=20 > This was intentional, the idea being that a 100% predictable branch in > a path where a syscall is being made anyway is much less expensive > than a GOT address load that gets hoisted all the way to the top of > the function and affects even code paths that don't need to make the > syscall. Whether it was a choice that makes sense overall, I'm not > sure, but that was the intent. Ok, I see. I came to it because I noticed that it might have real impact on the inline optimization that was e.g suggested for __wake. Also, as observed while doing this, this mixing of 128 and FUTEX_PRIVATE in the original code is really disruptive. Not withstanding that 128 is also the (explicitly used) value of the flag for mutexes, but that it has exactly the opposite meaning there, its presence means that the mutex is shared. Thanks Jens --=20 :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt :: --Sig_/_385sTT4L7ATlSsR/dC_3UX Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSN9stI2OFN1pLljN0P0+hp2tU34gUCWU1NCAAKCRAP0+hp2tU3 4mUGAJ45mZTxin03X7VvT0QnK0AFafwtPACeNGzQMjaoRQNLO+m/zP7wl0gCYso= =tmlm -----END PGP SIGNATURE----- --Sig_/_385sTT4L7ATlSsR/dC_3UX--