Re: LogwrtResult contended spinlock
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org, Jaime Casanova <jcasanov@systemguards.com.ec>
Date: 2022-03-22T16:11:20Z
Lists: pgsql-hackers
Attachments
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 — https://www.EnterpriseDB.com/ Officer Krupke, what are we to do? Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke")
Commits
-
Remove bogus assertion in pg_atomic_monotonic_advance_u64
- 768f0c3e21b3 18.0 landed
- 3a9d0d774d90 17.0 landed
-
Add XLogCtl->logInsertResult
- f3ff7bf83bce 17.0 cited
-
Operate XLogCtl->log{Write,Flush}Result with atomics
- ee1cbe806dad 17.0 landed
-
Split XLogCtl->LogwrtResult into separate struct members
- c9920a9068ea 17.0 landed
-
Introduce atomic read/write functions with full barrier semantics.
- bd5132db558b 17.0 cited
-
Reduce the number of GetFlushRecPtr() calls done by walsenders.
- e369f3708636 13.0 cited
-
Remove most volatile qualifiers from xlog.c
- 6ba4ecbf477e 9.5.0 cited