pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Jaime Casanova <jaime.casanova@2ndquadrant.com>
Subject: Re: LogwrtResult contended spinlock
Date: Tue, 24 Nov 2020 12:01:53 -0300
Message-ID: <20201124150153.GA10181@alvherre.pgsql> (raw)
In-Reply-To: <45bc9909-8f6c-74d8-83ac-d86d35e147cc@postgrespro.ru>

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.





view thread (74+ messages)  latest in thread

Message-ID: <20201124150153.GA10181@alvherre.pgsql>
Permalink:  ../20201124150153.GA10181@alvherre.pgsql/
Also on:    postgresql.org/message-id/20201124150153.GA10181@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, a.lubennikova@postgrespro.ru, andres@anarazel.de, jaime.casanova@2ndquadrant.com
  Subject: Re: LogwrtResult contended spinlock
  In-Reply-To: <20201124150153.GA10181@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox