Re: WAL Insertion Lock Improvements - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: WAL Insertion Lock Improvements
Date
Msg-id 20231219040029.GA723774@nathanxps13
Whole thread Raw
In response to Re: WAL Insertion Lock Improvements  (Michael Paquier <michael@paquier.xyz>)
Responses Re: WAL Insertion Lock Improvements
List pgsql-hackers
On Tue, Jul 25, 2023 at 04:43:16PM +0900, Michael Paquier wrote:
> 0001 has been now applied.  I have done more tests while looking at
> this patch since yesterday and was surprised to see higher TPS numbers
> on HEAD with the same tests as previously, and the patch was still
> shining with more than 256 clients.

I found this code when searching for callers that use atomic exchanges as
atomic writes with barriers (for a separate thread [0]).  Can't we use
pg_atomic_write_u64() here since the locking functions that follow should
serve as barriers?

I've attached a patch to demonstrate what I'm thinking.  This might be more
performant, although maybe less so after commit 64b1fb5.  Am I missing
something obvious here?  If not, I might rerun the benchmarks to see
whether it makes any difference.

[0] https://www.postgresql.org/message-id/flat/20231110205128.GB1315705%40nathanxps13

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Improve eviction algorithm in ReorderBuffer
Next
From: Thomas Munro
Date:
Subject: Re: Clang optimiser vs preproc.c