Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Date: 2016-04-18 14:48:24
Message-ID: CA+TgmoYYbYEehz9R50dMBNTc_5q7Fx9v6jug5DPpHYvCrEHaow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Apr 18, 2016 at 10:27 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2016-04-18 17:12:32 +0300, Alexander Korotkov wrote:
>> On Mon, Apr 18, 2016 at 2:34 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>
>> > On Sun, Apr 17, 2016 at 12:01 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > > Andres Freund <andres(at)anarazel(dot)de> writes:
>> > >> Allow Pin/UnpinBuffer to operate in a lockfree manner.
>> > >
>> > > 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. Please
>> > > expend some effort on making this less confusing for the next hacker.
>> > > Maybe make those comments talk about a "lock bit" instead?
>> >
>> > I was actually going to complain about this, too. I noticed it over
>> > the weekend when noodling around with another patch. I'm not sure
>> > exactly how it should be revised, but I find the current state of
>> > things confusing.
>> >
>>
>> +1
>> Do we have consensus on renaming "buffer header spinlock" to "buffer header
>> lock bit"?
>
> Personally I think the "spin" part is actually quite relevant, and I
> think we shouldn't loose it. It describes concurrency and blocking
> behaviour, and how errors need to be handled (i.e. there may not be
> any).

IMHO, "buffer header lock bit" is plenty clear enough. We could say
"buffer header spin lock bit" but I think that's too many words and
not actually more clear.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-04-18 14:58:35 Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.
Previous Message Andres Freund 2016-04-18 14:37:25 Re: pgsql: Allow Pin/UnpinBuffer to operate in a lockfree manner.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-04-18 14:52:13 Re: Refactor pg_dump as a library?
Previous Message Teodor Sigaev 2016-04-18 14:48:17 Re: GIN data corruption bug(s) in 9.6devel