Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btAFN-0000hx-Fi for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Oct 2016 09:18:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1btAFM-0006aL-21 for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Oct 2016 09:18:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1btAFK-0006aC-Ff for pgsql-hackers@postgresql.org; Sun, 09 Oct 2016 09:18:14 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1btAFC-00043C-Lx for pgsql-hackers@postgresql.org; Sun, 09 Oct 2016 09:18:13 +0000 Received: from msg.df7cb.de (120-058-210-188.ip-addr.inexio.net [188.210.58.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 3ssHjS17R5z3F11; Sun, 9 Oct 2016 11:18:04 +0200 (CEST) Date: Sun, 9 Oct 2016 11:18:03 +0200 From: Christoph Berg To: Tom Lane Cc: Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: Switch to unnamed POSIX semaphores as our preferred sema code? Message-ID: <20161009091803.fag2mkehtuknd5s6@msg.df7cb.de> Mail-Followup-To: Christoph Berg , Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" References: <8536.1475704230@sss.pgh.pa.us> <15690.1475761593@sss.pgh.pa.us> <29244.1475959928@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="44sbcc5qsqc6v2bq" Content-Disposition: inline In-Reply-To: <29244.1475959928@sss.pgh.pa.us> User-Agent: NeoMutt/20160916 (1.7.0) X-Pg-Spam-Score: -4.6 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --44sbcc5qsqc6v2bq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Re: Tom Lane 2016-10-08 <29244.1475959928@sss.pgh.pa.us> > So I'm still of the opinion that there's not likely to be any meaningful > performance difference in practice, at least not on reasonably recent > Linux machines. But this does indicate that if there is any difference, > it will probably favor switching. Another data point that's admittedly much more of a footnote than serious input to the original question is the following: Debian has a (so far mostly toy) port "hurd-i386" which is using the GNU hurd kernel along with the usual GNU userland that's also in use on Linux. This OS doesn't implement any semaphores yet (PG compiles, but initdb dies with ENOSYS immediately). On talking to the porters, they advised that POSIX semaphores would have the best chances to get implemented first, so I added USE_UNNAMED_POSIX_SEMAPHORES=3D1 to the architecture template to be prepared for that. Christoph (The patch quoted below is obviously Debian-specific and not meant for inclusion upstream.) hurd doesn't support sysv semaphores (semget), and needs -pthread to find sem_init. POSIX semaphores shared between processes (sem_init(pshared =3D 1= )) aren't supported yet either, but have the best chance to get implemented, s= o be prepared. FATAL: could not create semaphores: Function not implemented DETAIL: Failed system call was semget(1, 17, 03600). undefined reference to symbol 'sem_init@@GLIBC_2.12' --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -109,6 +109,10 @@ endif =20 endif # aix =20 +ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS), hurd) +LIBS +=3D -pthread +endif # hurd + # Update the commonly used headers before building the subdirectories $(SUBDIRS:%=3D%-recursive): | generated-headers =20 --- a/src/template/linux +++ b/src/template/linux @@ -28,3 +28,10 @@ if test "$SUN_STUDIO_CC" =3D "yes" ; then ;; esac fi + +# force use of POSIX instead of SysV semaphores on hurd-i386 +case $(dpkg-architecture -qDEB_HOST_ARCH) in + hurd*) + USE_UNNAMED_POSIX_SEMAPHORES=3D1 + ;; +esac --44sbcc5qsqc6v2bq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAABCAAGBQJX+gtKAAoJEExaa6sS0qeuj1gQAJBn1p2MAz6uMttWjZqiGCVn kut0OV0QIl8i+4vSwdBrQMSISFg0liPCrKB/CLGCDv3xlu+8yF+BxcRgp92/vhYq Zga66xueki2RWvx86yE8B6pu7ETBcjkxkd8LfHVeAe4bm60SCHlJFsPg6fleNXVr zbzse05L6t/HFJNvMBMH+8cft+ukvITPYRCcaaYtJ7RxOIDZssD1Uo3CE20GBOkc krIpcE3dmB72FB1Q/mNdDL8p3G8Cq8W4lm5yTkUNSgjHt+Yrv1PpMXe4gsgqn1kh Yf2atBsGk525Y/J+9EJLUD6l6lixEW8ifN4VYYyO/v/9L3ZpETyHgxR3elhkRNa/ U6tKbrEVuOs5dkHcKVTGBpOvJpCcWW3Ne8wfsFq0z+EfflDfLwmLebDnLpemfEri nPEncFEqBehdxRMayE1wxe3j6Tww6pfNRogQ0ElsTW3uggdQjynOwB3VuvlFmWHr /aIuqLjtJ7zWC2DWjETRoJuu71QCmOBsESiJIgpRnxqajG8g+n/6zJepXfMf/hBg rk0FuV3YsYPxEjAJNb+PBMVHeXO+bBaYjeJVmuHKH3zq2tMINjcJCdQ66Wh3n0vI 5aVSujt2H3OTKeRegxtMxNyu4n3aiXvA30HyPKySxfL9Ze8Takj+IEXIwhNskU2x ADAgyN1N5l8RqBM3Bhuo =sASY -----END PGP SIGNATURE----- --44sbcc5qsqc6v2bq--