Re: LogwrtResult contended spinlock
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org, Jaime Casanova <jaime.casanova@2ndquadrant.com>
Date: 2020-11-24T15:01:53Z
Lists: pgsql-hackers
On 2020-Nov-24, Anastasia Lubennikova wrote: > On 04.09.2020 20:13, Andres Freund wrote: > > Re general routine: On second thought, it might actually be worth having > > it. Even just for LSNs - there's plenty places where it's useful to > > ensure a variable is at least a certain size. I think I would be in > > favor of a general helper function. > Do you mean by general helper function something like this? > > void > swap_lsn(XLogRecPtr old_value, XLogRecPtr new_value, bool to_largest) Something like that, yeah, though maybe name it "pg_atomic_increase_lsn" or some similar name that makes it clear that 1. it is supposed to use atomics 2. it can only be used to *advance* a value rather than a generic swap. (I'm not 100% clear that that's the exact API we need.) > This CF entry was inactive for a while. Alvaro, are you going to continue > working on it? Yes, please move it forward. I'll post an update sometime before the next CF.
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