pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Bernd Helmle <mailings@oopsware.de>
Subject: Re: [HACKERS] Deadlock in XLogInsert at AIX
Date: Wed, 09 Oct 2019 13:15:29 -0400
Message-ID: <6444.1570641329@sss.pgh.pa.us> (raw)
In-Reply-To: <20191009063900.GA4066266@rfd.leadboat.com>
References: <15802dd8-4601-d9d2-3388-35dcb326b4a2@iki.fi>
	<20170203002650.GA775605@tornado.leadboat.com>
	<20180116071211.GB3679@paquier.xyz>
	<20180116165024.4j24kgfqmjmrrqf7@alap3.anarazel.de>
	<20180117083631.GB3885604@rfd.leadboat.com>
	<20190831071157.GA3251746@rfd.leadboat.com>
	<2525.1567276075@sss.pgh.pa.us>
	<20190831223026.GA3257395@rfd.leadboat.com>
	<20191005173400.GA3979129@rfd.leadboat.com>
	<5304.1570475195@sss.pgh.pa.us>
	<20191009063900.GA4066266@rfd.leadboat.com>

Noah Misch <noah@leadboat.com> writes:
> On Mon, Oct 07, 2019 at 03:06:35PM -0400, Tom Lane wrote:
>> This still fails on Apple's compilers. ...

> Thanks for testing.  That error boils down to "need to use some other
> register".  The second operand of addi is one of the ppc instruction operands
> that can hold a constant zero or a register number[1], so the proper
> constraint is "b".  I've made it so and added a comment.

Ah-hah.  This version does compile and pass check-world for me.

> I should probably
> update s_lock.h, too, in a later patch.  I don't know how it has
> mostly-avoided this failure mode, but its choice of constraint could explain
> https://postgr.es/m/flat/36E70B06-2C5C-11D8-A096-0005024EF27F%40ifrance.com

Indeed.  It's a bit astonishing that more people haven't hit that.
This should be back-patched.


Now that the patch passes mechanical checks, I took a closer look,
and there are some things I don't like:

* I still think that the added configure test is a waste of build cycles.
It'd be sufficient to test "#ifdef HAVE__BUILTIN_CONSTANT_P" where you
are testing HAVE_I_CONSTRAINT__BUILTIN_CONSTANT_P, because our previous
buildfarm go-round with this showed that all supported compilers
interpret "i" this way.

* I really dislike building the asm calls with macros as you've done
here.  The macros violate project style, and are not remotely general-
purpose, because they have hard-wired references to variables that are
not in their argument lists.  While that could be fixed with more
arguments, I don't think that the approach is readable or maintainable
--- it's impossible for example to understand the register constraints
without looking simultaneously at the calls and the macro definition.
And, as we've seen in this "b" issue, the interactions between the chosen
instruction types and the constraints are subtle enough to make me wonder
whether you won't need even more arguments to allow some of the other
constraints to be variable.  I think it'd be far better just to write out
the asm in-line and accept the not-very-large amount of code duplication
you'd get.

* src/tools/pginclude/headerscheck needs the same adjustment as you
made in cpluspluscheck.

			regards, tom lane





view thread (51+ messages)  latest in thread

Message-ID: <6444.1570641329@sss.pgh.pa.us>
Permalink:  ../6444.1570641329@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6444.1570641329@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, noah@leadboat.com, michael.paquier@gmail.com, andres@anarazel.de, hlinnaka@iki.fi, k.knizhnik@postgrespro.ru, mailings@oopsware.de
  Subject: Re: [HACKERS] Deadlock in XLogInsert at AIX
  In-Reply-To: <6444.1570641329@sss.pgh.pa.us>
  References: <15802dd8-4601-d9d2-3388-35dcb326b4a2@iki.fi> <20170203002650.GA775605@tornado.leadboat.com> <20180116071211.GB3679@paquier.xyz> <20180116165024.4j24kgfqmjmrrqf7@alap3.anarazel.de> <20180117083631.GB3885604@rfd.leadboat.com> <20190831071157.GA3251746@rfd.leadboat.com> <2525.1567276075@sss.pgh.pa.us> <20190831223026.GA3257395@rfd.leadboat.com> <20191005173400.GA3979129@rfd.leadboat.com> <5304.1570475195@sss.pgh.pa.us> <20191009063900.GA4066266@rfd.leadboat.com> <6444.1570641329@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox