Re: [PATCH] audo-detect and use -moutline-atomics compilation flag for aarch64

From: Christoph Berg <myon(at)debian(dot)org>
To: "Pop, Sebastian" <spop(at)amazon(dot)com>
Cc: PostgreSQL in Debian <pgsql-pkg-debian(at)postgresql(dot)org>, "Saidi, Ali" <alisaidi(at)amazon(dot)com>, "Csoma, Csaba" <csabac(at)amazon(dot)com>
Subject: Re: [PATCH] audo-detect and use -moutline-atomics compilation flag for aarch64
Date: 2021-11-11 16:55:58
Message-ID: YY1LHr9YYQb0Ds8h@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian

Re: Pop, Sebastian
> > Not here:
> > $ gcc --version
> > gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> > $ gcc -v --help -Q 2>/dev/null | grep outline-atomics
>
> This needs to be on an arm64 machine.

Oh, sure. Sorry I was missing a lot of context that wasn't immediately
clear.

> The outline-atomics flag does not exist when targeting x86_64.
> The flag has been back-ported to Ubuntu 20.04 a year and a half ago: IIRC, it went in just before the release in April 2020.

It is indeed present there, but not enabled:

$ for chroot in *; do echo $chroot:; schroot -c $chroot -- gcc -v --help -Q 2>&1 | grep outline-atomics; done
bionic-arm64:
bookworm-arm64:
-moutline-atomics [enabled]
bullseye-arm64:
-moutline-atomics [enabled]
buster-arm64:
focal-arm64:
-moutline-atomics [disabled]
sid-arm64:
-moutline-atomics [enabled]

The (newer) Debian dists have it enabled by default.

> > Did you rebuild the package locally without changing the Debian version?
>
> I have not re-compiled gcc. The gcc-9.3 is the one distributed as part of Ubuntu 20.04.

Again, that was a lot of context I didn't have.

> If you need access to Graviton2 instances, we have a system of credits that we can use to fund compute time for open-source CI projects.
> Let me know if you are interested in getting those compute credits, and I will take the request to my management.

Thanks for the offer - we already have a arm64 build node sponsored by
Huawei that does the job for now.

Re: Pop, Sebastian
> Could you please let me know what is the process to enable -moutline-atomics for arm64 binaries distributed by PostgreSQL for Ubuntu 20.04?
> Using the right LSE atomic instructions is very important for the performance of PostgreSQL on all new arm64 processors.
> Please let me know how I can help to enable the flag, test, and benchmark the new packages.

First, we need to be convinced it's a good idea. From that I got from
the messages you were linking to, Heikki "definitely do[es]n't want to
override that decision", and Tom doesn't "find this argument terribly
convincing".

The benchmarks in
https://www.postgresql.org/message-id/1C8D0E58-FB33-4105-AC00-8FA07621F5DD%40amazon.com
don't look like the option is a game-changer.

Even if we are convinced, we don't have the infrastructure in the
package yet to do architecture- and distribution-specific
optimizations. Would you (Amazon?) be willing to sponsor the required
package engineering?

Christoph

In response to

Responses

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message Pop, Sebastian 2021-11-11 17:11:02 Re: [PATCH] audo-detect and use -moutline-atomics compilation flag for aarch64
Previous Message apt.postgresql.org Repository Update 2021-11-11 16:33:04 pgtap updated to version 1.1.0-7.pgdg+1