From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Kevin Grittner <kgrittn@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Date: Wed, 13 Apr 2016 08:18:01 -0700
Message-ID: <20160413151801.nafgcxlitagi6fec@alap3.anarazel.de> (raw)
In-Reply-To: <22526.1460558523@sss.pgh.pa.us>
References: <20160412185625.g7ixnlpwaqvsqt7v@alap3.anarazel.de>
<20160413025214.GA954515@alvherre.pgsql>
<20160413030530.dfldqhmtojo222c4@alap3.anarazel.de>
<CA+TgmoZqN0xevR+1pZ6j-99-ZCBoOphr-23tiREb+QW1Eu=KOA@mail.gmail.com>
<20591.1460555524@sss.pgh.pa.us>
<CA+TgmoY9VeZdTZkTp8SKoXPKKj0PGu2aKPt0dLTDDsgu+vm0yw@mail.gmail.com>
<21698.1460557237@sss.pgh.pa.us>
<CA+TgmoZYFZqLukuiRvz_izNPno+WqKVorcEvAi0jOSs0MsKhWA@mail.gmail.com>
<22526.1460558523@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 2016-04-13 10:42:03 -0400, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > On Wed, Apr 13, 2016 at 10:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> That's what I thought you were going to say, and it means that any
> >> "performance improvement" patch that relies on 64-bit atomics in hotspot
> >> code paths is going to be a complete disaster on anything but modern Intel
> >> hardware. I'm not sure that's a direction we want to go in. We need to
> >> stick to a set of atomics that's pretty widely portable.
>
> > I think 64-bit atomics *are* pretty widely portable. Can you name a
> > system with more than 4 CPU cores that doesn't support them?
>
> No, you're ignoring my point, which is what happens on single-CPU
> 32-bit machines, and whether we aren't going to destroy performance
> on low-end machines in pursuit of better performance on high-end.
I think generally the only platform of concern wrt is arm (< armv8),
which doesn't have 64bit atomicity and doesn't have
single-copy-atomicity for 8 byte values either (C.f.
https://wiki.postgresql.org/wiki/Atomics). But:
> Now, to the extent that a patch uses a 64-bit atomic op to replace
> a spinlock acquisition, it might be pretty much a wash if low-end
> machines have to use a spinlock to emulate the atomic op. But it
> would be really easy for the translation to replace one spinlock
> acquisition with multiple spinlock acquisitions, and that would hurt.
Which is why I'm actually proposing to *not* use a pg_atomic_uint64, just a
single define to remove the spinlock acquisition:
http://archives.postgresql.org/message-id/20160413150839.mevdlgekizxyjhc5%40alap3.anarazel.de
I think there are a number of LSNs which we'd be better of replacing LSN
manipulations with an actual atomic operation (including fallback to the
spinlock) might be beneficial. But that'd be a larger patch, and would
require more testing; which is why I'm proposing the above.
Greetings,
Andres Freund
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-committers@postgresql.org
Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, alvherre@2ndquadrant.com, noah@leadboat.com, kgrittn@gmail.com, kgrittn@postgresql.org, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
In-Reply-To: <20160413151801.nafgcxlitagi6fec@alap3.anarazel.de>
References: <20160412185625.g7ixnlpwaqvsqt7v@alap3.anarazel.de> <20160413025214.GA954515@alvherre.pgsql> <20160413030530.dfldqhmtojo222c4@alap3.anarazel.de> <CA+TgmoZqN0xevR+1pZ6j-99-ZCBoOphr-23tiREb+QW1Eu=KOA@mail.gmail.com> <20591.1460555524@sss.pgh.pa.us> <CA+TgmoY9VeZdTZkTp8SKoXPKKj0PGu2aKPt0dLTDDsgu+vm0yw@mail.gmail.com> <21698.1460557237@sss.pgh.pa.us> <CA+TgmoZYFZqLukuiRvz_izNPno+WqKVorcEvAi0jOSs0MsKhWA@mail.gmail.com> <22526.1460558523@sss.pgh.pa.us> <20160413151801.nafgcxlitagi6fec@alap3.anarazel.de>
* 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