From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Date: Mon, 18 Apr 2016 07:37:25 -0700
Message-ID: <20160418143725.cpgt544cwtjftxdr@alap3.anarazel.de> (raw)
In-Reply-To: <11405.1460913629@sss.pgh.pa.us>
References: <E1apSHT-0007xJ-Bh@gemulon.postgresql.org>
<9194.1460908908@sss.pgh.pa.us>
<20160417170736.hbly4drjqdhnb5rm@alap3.anarazel.de>
<11405.1460913629@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 2016-04-17 13:20:29 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2016-04-17 12:01:48 -0400, Tom Lane wrote:
> >> Now that I've had some occasion to look around in bufmgr.c, I am very
> >> unhappy that there are still boatloads of comments talking about a buffer
> >> header's spinlock, when there is in fact no spinlock anymore.
>
> > That's actually intentional. Alexander had changed those, and it made
> > the patch a good bit harder to read because there's so many references.
> > As the new thing is still a spinlock, just not a s_lock.[ch] style on, I
> > don't see changing all that to be a significant benefit.
>
> Well, I disagree: we consistently use "spinlock" to mean the s_lock.h
> mechanism. Lock mechanisms are important, so using the same terminology
> to refer to different implementations is not helpful. Especially when
> it means you have no way to talk about one implementation as opposed
> to the other.
"s_lock.h" style spinlock vs. "BufferDesc type spinlock" etc. seems to
work. Given where vertical scalability is going (more cores, more numa
partitions (two in one socket now!), ...), it seems quite likely that
we'll end up with further special case implementations. I don't think
we'll be served well naming them differently if they have very similar
rules to s_lock.h style spinlocks.
> Imagine writing a comment that says "back when we used
> to use spinlocks for this, we had to do FOO. Now that we use spinlocks,
> we can do BAR instead."
"Back when buffer locking used a s_lock.h style spinlock, ..., but now
that it's just a flag in the BufferDesc's state, ...".. Doesn't seem
like a problem.
Greetings,
Andres Freund
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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
Subject: Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
In-Reply-To: <20160418143725.cpgt544cwtjftxdr@alap3.anarazel.de>
References: <E1apSHT-0007xJ-Bh@gemulon.postgresql.org> <9194.1460908908@sss.pgh.pa.us> <20160417170736.hbly4drjqdhnb5rm@alap3.anarazel.de> <11405.1460913629@sss.pgh.pa.us> <20160418143725.cpgt544cwtjftxdr@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