Re: Remove header lock BufferGetLSNAtomic() on architectures with 64 bit atomic operations

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove header lock BufferGetLSNAtomic() on architectures with 64 bit atomic operations
Date: 2026-01-14 06:31:40
Message-ID: 375e47d7-0423-4537-b5d5-72ecc0549535@proxel.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/2/26 4:27 PM, Andres Freund wrote:
> A volatile on a non-pointer won't do you much good, I'm afraid. You need to
> make sure that the underlying value is read as a single 8 byte read, I don't
> see how this guarantees that, unfortunately.

Yeah, that was a quite big thinko. I have a attached a patch with the
thinko fixed but I am still not happy with it. I think I will try to use
atomics.h and see if that makes the code nicer to read.

Also will after that see what I can do about pageinspect.

Andreas

Attachment Content-Type Size
v2-0001-Do-not-lock-in-BufferGetLSNAtomic-on-archs-with-8.patch text/x-patch 5.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-01-14 06:37:26 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
Previous Message Michael Paquier 2026-01-14 06:17:20 Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL