Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i9CnG-0001eS-Fe for pgsql-committers@arkaria.postgresql.org; Sat, 14 Sep 2019 18:29:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i9CnD-0007vQ-BW for pgsql-committers@arkaria.postgresql.org; Sat, 14 Sep 2019 18:29:07 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1i9CnD-0007vB-4f for pgsql-committers@lists.postgresql.org; Sat, 14 Sep 2019 18:29:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i9Cn8-0002fr-Vu for pgsql-committers@lists.postgresql.org; Sat, 14 Sep 2019 18:29:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x8EISwZK031593; Sat, 14 Sep 2019 14:28:58 -0400 From: Tom Lane To: Noah Misch cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: For all ppc compilers, implement pg_atomic_fetch_add_ with inlin In-reply-to: <20190914171154.GA3487808@rfd.leadboat.com> References: <7517.1568470247@sss.pgh.pa.us> <20190914171154.GA3487808@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Sat, 14 Sep 2019 10:11:54 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31591.1568485738.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 14 Sep 2019 14:28:58 -0400 Message-ID: <31592.1568485738@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Noah Misch writes: > On Sat, Sep 14, 2019 at 10:10:47AM -0400, Tom Lane wrote: >> prairiedog thinks there's something wrong here --- probably, some globa= l >> enabling #define is missing? > I can reproduce its situation by commenting out the HAVE_GCC_ symbols in > pg_config.h. This commit did "#define PG_HAVE_ATOMIC_U32_SUPPORT" but d= efined > only fetch_add, not compare_exchange. That works with generic-gcc.h, bu= t > fallback.h can't replace just one. (Rightly so -- fallback.h defines th= e > pg_atomic_uint32 structure differently.) Agreed on that diagnosis. > I can see these ways to fix this: > 1. Add pg_atomic_compare_exchange_u{32,64}_impl to arch-ppc.h > 2. Arrange for arch-ppc.h to be a no-op when GCC atomics are unavailable > 3. Just revert > (1) seems best. Since it may be days or weeks before I get to that, I'm > inclined to revert after ~24h of total buildfarm exposure. Yeah, seems like it should be possible to build atomic_compare_exchange as an LWARX/STWCX loop, but it will take a little work. I concur with waiting till your AIX flotilla has checked in before reverting. One thing we could find out that way is whether we actually need the added configure test. The returns so far say we don't: cavefish | 2019-09-14 04:38:49 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes chub | 2019-09-14 15:10:02 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes clam | 2019-09-14 09:30:04 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes cuon | 2019-09-14 06:57:23 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes demoiselle | 2019-09-14 15:15:45 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes devario | 2019-09-14 14:25:21 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes dhole | 2019-09-14 05:46:33 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes elasmobranch | 2019-09-14 03:18:50 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes gadwall | 2019-09-14 12:39:48 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes prairiedog | 2019-09-14 08:12:53 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes quokka | 2019-09-14 08:46:25 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes shoveler | 2019-09-14 14:44:30 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes takin | 2019-09-14 08:49:27 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes tern | 2019-09-14 09:51:04 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes urocryon | 2019-09-14 06:45:31 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes vulpes | 2019-09-14 09:35:41 | checking whether __builtin_constant= _p(x) implies "i"(x) acceptance... yes If the other AIX critters agree with tern, I'd be inclined to drop the configure test and just make the code check for HAVE__BUILTIN_CONSTANT_P. regards, tom lane