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

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Remove header lock BufferGetLSNAtomic() on architectures with 64 bit atomic operations
Date: 2026-02-05 15:38:27
Message-ID: CAH2-Wzk7Kdk5Mz696J9p-JwX61tb2vyAjdAeagXLmXxUp1ADCw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 14, 2026 at 1:31 AM Andreas Karlsson <andreas(at)proxel(dot)se> wrote:
> 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.

I believe that pageinspect's heap_page_items function needs to use
get_page_from_raw -- see commit 14e9b18fed.

Attached patch 0002-* shows what's required. I'm including your
original 0001-* patch from your v2 here, to keep CFTester happy.

We (Tomas Vondra and I) are treating this as a dependency for our
index prefetching patch. It'd be good to get this done soon.
--
Peter Geoghegan

Attachment Content-Type Size
v3-0002-Make-pageinspect-s-heap_page_items-use-get_page_f.patch application/x-patch 3.1 KB
v3-0001-Do-not-lock-in-BufferGetLSNAtomic-on-archs-with-8.patch application/x-patch 5.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-02-05 15:44:50 Re: [PATCH] Support reading large objects with pg_read_all_data
Previous Message Tom Lane 2026-02-05 15:25:25 Re: Non-deterministic buffer counts reported in execution with EXPLAIN ANALYZE BUFFERS