Re: use a non-locking initial test in TAS_SPIN on AArch64

From: "Burd, Greg" <greg(at)burd(dot)me>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Salvatore Dipietro <dipiets(at)amazon(dot)it>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, mrdrivingduck(at)gmail(dot)com, andres(at)anarazel(dot)de, tgl(at)sss(dot)pgh(dot)pa(dot)us, dipietro(dot)salvatore(at)gmail(dot)com
Subject: Re: use a non-locking initial test in TAS_SPIN on AArch64
Date: 2026-09-15 17:22:24
Message-ID: 6EDE0F59-5517-4F52-9584-A9252E59317E@burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sep 15, 2026, at 10:51 AM, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Tue, Sep 15, 2026 at 11:46:23AM +0000, Salvatore Dipietro wrote:
>> I'd like to propose backporting this commit 3d0b4b1068 ("Use a
>> non-locking initial test in TAS_SPIN on AArch64.", Nathan Bossart,
>> 2025-01-10), which first shipped in PostgreSQL 18, to the supported
>> back branches: REL_17_STABLE, REL_16_STABLE and REL_15_STABLE.
>
> I think that's fine. It was likely an oversight when AArch64 support was
> first added to this file, anyway. We could also back-patch to v14, but
> that would look a little different since it is missing commit a82a5eee31
> ("Use ISB as a spin-delay instruction on ARM64"). Since v14 is set to go
> out-of-support in a couple months, I'd probably just stop at v15 and call
> it a day, though.

+1 for backpatching to v15

> With huge_pages=on both effects largely disappear: huge pages mask the
>> paging defect, and TTAS is neutral.
>>
>> The change is a one-line, so a backport looks low-risk and would spare
>> pre-18 AArch64 users a severe regression as PREEMPT_LAZY kernels ship.
>
> I'm curious why you are testing without huge pages enabled. My
> understanding is that any serious workload on the kinds of machines you are
> using for your benchmarks would use them.

I agree with Nathan, that should have a positive impact. 95GiB shared_buffers
on 4 KB pages is a TLB disaster. With ~4 KB pages, a buffer pool that size
needs ~25 million page-table entries; the TLB on Graviton4 cores covers only
a few thousand entries, so heavy concurrent access to shared memory causes
constant TLB misses and page-table walks. I bet you can measure for this
effect to validate that's happening.

2 MB (or larger) pages cut the translation footprint by ~500x, give it a
try.

best.

-greg

> --
> nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Sami Imseih 2026-09-15 17:10:54 Re: Report index currently being vacuumed in pg_stat_progress_vacuum