Re: LogwrtResult contended spinlock

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Subject: Re: LogwrtResult contended spinlock
Date: 2022-03-22 16:11:20
Message-ID: 202203221611.hqbjdinzsbu2@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2022-Mar-22, Tom Lane wrote:

> I looked briefly at 0001, and I've got to say that I disagree with
> your decision to rearrange the representation of the local LogwrtResult
> copy. It clutters the patch tremendously and makes it hard to
> understand what the actual functional change is. Moreover, I'm
> not entirely convinced that it's a notational improvement in the
> first place.
> Perhaps it'd help if you split 0001 into two steps, one to do the
> mechanical change of the representation and then a second patch that
> converts the shared variable to atomics. Since you've moved around
> the places that read the shared variable, that part is subtler than
> one could wish and really needs to be studied on its own.

Hmm, I did it the other way around: first change to use atomics, then
the mechanical change. I think that makes the usefulness of the change
more visible, because before the atomics use the use of the combined
struct as a unit remains sensible.

Álvaro Herrera Breisgau, Deutschland —
Officer Krupke, what are we to do?
Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke")

Attachment Content-Type Size
v7-0001-Change-XLogCtl-LogwrtResult-to-use-atomic-ops.patch text/x-diff 12.7 KB
v7-0002-Split-LogwrtResult-into-separate-variables.patch text/x-diff 17.2 KB
v7-0003-Change-asyncXactLSN-and-WalWriterSleeping-to-atom.patch text/x-diff 4.2 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2022-03-22 16:15:10 Re: Partial aggregates pushdown
Previous Message Mark Dilger 2022-03-22 16:11:09 Re: New Object Access Type hooks