Re: LogwrtResult contended spinlock

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Jaime Casanova <jaime(dot)casanova(at)2ndQuadrant(dot)com>
Subject: Re: LogwrtResult contended spinlock
Date: 2020-08-31 18:34:45
Message-ID: 20200831183445.GA23447@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Aug-31, Andres Freund wrote:

> Hi,
>
> On August 31, 2020 11:21:56 AM PDT, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:

> >At first I wanted to make the new LWLock cover only LogwrtResult
> >proper,
> >and leave LogwrtRqst alone. However on doing it, it seemed that that
> >might change the locking protocol in a nontrivial way. So I decided to
> >make it cover both and call it a day. We did verify that the patch
> >solves the reported problem, at any rate.
>
> Wouldn't the better fix here be to allow reading of individual members
> without a lock? E.g. by wrapping each in a 64bit atomic.

Heh, Simon said the same. It's not clear to me due to the lack of
general availability of 64-bit atomics. If they are spinlock-protected
when emulated, I think that would make the problem worse.

IIRC Thomas wanted to start relying on atomic 64-bit vars in some patch,
but I don't remember what it was.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2020-08-31 18:38:11 Re: list of extended statistics on psql
Previous Message Tom Lane 2020-08-31 18:31:24 Re: Sometimes the output to the stdout in Windows disappears