From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Date: Mon, 11 Apr 2016 20:36:18 -0700
Message-ID: <20160412033618.c56ksvf3me4mpwii@alap3.anarazel.de> (raw)
In-Reply-To: <1881.1460431476@sss.pgh.pa.us>
References: <E1apSHT-0007xJ-Bh@gemulon.postgresql.org>
<1881.1460431476@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 2016-04-11 23:24:36 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Allow Pin/UnpinBuffer to operate in a lockfree manner.
>
> This commit has broken buildfarm member gaur, and no doubt pademelon
> will be equally unhappy once it catches up to HEAD. The reason is that
> you've caused localbuf.c to perform a whole bunch of atomic operations
> on its buffer headers; and on machines that don't have native atomic
> ops, there's a spinlock underlying those; and you did not bother to
> ensure that appropriate SpinLockInit operations happen for local-buffer
> headers. (HPPA, possibly alone among supported platforms, does not
> think that SpinLockInit is equivalent to memset-to-zeroes.)
That's obviously borked, and need to be fixed.
> While we could fix this by performing suitable SpinLockInit's on
> local-buffer headers, I have to think that that's fundamentally the
> wrong direction. The *entire* *point* of having local buffers is
> that they are not subject to concurrency overhead. So IMO, sticking
> atomic-ops calls into localbuf.c is broken on its face.
Note that localbuf.c tries to be careful to only use
pg_atomic_read_u32/pg_atomic_write_u32 - which don't have a concurrency
overhead as they don't utilize atomic ops.
The issue is likely that either Alexander or I somehow made
MarkLocalBufferDirty() use pg_atomic_fetch_or_u32(), instead of the
proper pg_atomic_read_u32()/pg_atomic_write_u32().
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, pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
In-Reply-To: <20160412033618.c56ksvf3me4mpwii@alap3.anarazel.de>
References: <E1apSHT-0007xJ-Bh@gemulon.postgresql.org> <1881.1460431476@sss.pgh.pa.us> <20160412033618.c56ksvf3me4mpwii@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