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

From: "Zidenberg, Tsahi" <tsahee(at)amazon(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] audo-detect and use -moutline-atomics compilation flag for aarch64
Date: 2020-07-01 15:40:38
Message-ID: 099F69EE-51D3-4214-934A-1F28C0A1A7A7@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Outline-atomics is a gcc compilation flag that adds runtime detection of weather or not the cpu supports atomic instructions. CPUs that don't support atomic instructions will use the old load-exclusive/store-exclusive instructions. If a different compilation flag defined an architecture that unconditionally supports atomic instructions (e.g. -march=armv8.2), the outline-atomic flag will have no effect.

The patch was tested to improve pgbench simple-update by 10% and sysbench write-only by 3% on a 64-core armv8.2 machine (AWS m6g.16xlarge). Select-only and read-only benchmarks were not significantly affected, and neither was performance on a 16-core armv8.0 machine that does not support atomic instructions (AWS a1.4xlarge).

The patch uses an existing configure.in macro to detect compiler support of the flag. Checking for aarch64 machine is not strictly necessary, but was added for readability.

Thank you!
Tsahi

Attachment Content-Type Size
0001-Support-outline-atomics-on-aarch64.patch application/octet-stream 4.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-07-01 15:42:25 Re: SQL-standard function body
Previous Message Stephen Frost 2020-07-01 15:33:53 Re: Remove Deprecated Exclusive Backup Mode