Re: Improving spin-lock implementation on ARM.

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Krunal Bauskar <krunalbauskar(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improving spin-lock implementation on ARM.
Date: 2020-11-30 13:16:28
Message-ID: CAPpHfdvJ=PR_HWFvu+LP=uAesqq82V_bSaoa=VYBhZw+zNQTbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 30, 2020 at 9:08 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Krunal Bauskar <krunalbauskar(at)gmail(dot)com> writes:
> > On Mon, 30 Nov 2020 at 10:14, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> The results I posted at [1] seem to contradict this for Apple's new
> >> machines.
>
> > For the results you saw on Mac-Mini was LSE enabled by default.
>
> Hmm, I don't know how to get Apple's clang to admit what its default
> settings are ... anybody?
>
> However, it does accept "-march=armv8-a+lse", and that seems to
> not be the default, because I get different results from my spinlock-
> pounding test than I did yesterday. Abbreviating into a table:
>
> --- CFLAGS=-O2 --- --- CFLAGS="-O2 -march=armv8-a+lse" ---
>
> TPS HEAD CAS patch HEAD CAS patch
>
> clients=1 2127 2174 2612 2722
> clients=2 1816 859 892 950
> clients=4 714 519 610 468
> clients=8 - - 108 185
>
> Unfortunately, that still doesn't lead me to think that either LSE
> or CAS are net wins on this hardware. It's quite clear that LSE
> makes the uncontended case a good bit faster, but the contended case
> is a lot worse, so is that really a tradeoff we want?

I tend to think that LSE is enabled by default in Apple's clang based
on your previous message[1]. In order to dispel the doubts could you
please provide assembly of SpinLockAcquire for following clang
options.
"-O2"
"-O2 -march=armv8-a+lse"
"-O2 -march=armv8-a"

Thank you!

Links
1. https://www.postgresql.org/message-id/663376.1606432828%40sss.pgh.pa.us

------
Regards,
Alexander Korotkov

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2020-11-30 13:18:32 Re: Printing LSN made easy
Previous Message Peter Eisentraut 2020-11-30 13:14:30 Re: proposal: unescape_text function