Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Apr 30, 2025 at 4:53 AM Salvatore Dipietro
> <dipietro.salvatore@gmail.com> wrote:
>> we would like to propose the removal of the Instruction
>> Synchronization Barrier (isb) for aarch64 architectures. Based on our
>> testing on Graviton instances (m7g.16xlarge), we can see on average
>> over multiple iterations up to 12% better performance using PGBench
>> select-only and up to 9% with Sysbench oltp_read_only workloads. On
>> Graviton4 (m8g.24xlarge) results are up to 8% better using PGBench
>> select-only and up to 6% with Sysbench oltp_read_only workloads.
>> We have also tested it putting more pressure on the spin_delay
>> function, enabling pg_stat_statements.track_planning with PGBench
>> read-only [0] and, on average, the patch shows up to 27% better
>> performance on m6g.16xlarge and up to 37% on m7g.16xlarge.
> I think you should make some kind of argument about why the previous
> conclusion was wrong, or why something's changed between then and now.
TBH, those numbers are large enough that I flat out don't believe
them. As noted in the previous thread, we've managed to squeeze out
a lot of our dependencies on spinlock performance, via algorithmic
changes, migration to atomic ops, etc. So I think ten-percent-ish
improvement on a plain pgbench test just isn't very plausible.
We certainly didn't see that kind of effect when we were doing that
earlier round of testing --- we had to use a custom testing lashup
to get numbers that were outside the noise at all.
Of course, microbenchmarking is a tricky business, so it's possible
that a different custom testing lashup would show the opposite
results. But what's quoted above is sufficiently unlike our prior
results that I can't help thinking something is wrong.
One other thing that comes to mind is that pg_stat_statements
has stretched the intention of "short straight-line code segment"
to the point of unrecognizability. Maybe it needs to stop using
spinlocks to protect pgssEntry updates. But I'm not sure if that
would move the needle on whether ISB is a good idea or not.
regards, tom lane