Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers

From: Greg Burd <greg(at)burd(dot)me>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dave Cramer <davecramer(at)gmail(dot)com>
Subject: Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers
Date: 2025-11-22 21:43:30
Message-ID: 15B1EDC6-3093-41FD-96C6-7E6B02CA6D36@greg.burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Okay,

With the new MSVC compiler flag Andres mentioned (/arch:armv9.4) I only
had to update the S_UNLOCK() macro, the compiler did the rest correctly
AFAICT. So, a much smaller patch (v2) attached. FWIW I'm using Visual
Studio 2026 (18) to build, other platform information below [1].

The white space/formatting issues seem to have been due to my ineptitude
on Windows running pgindent, or maybe I can blame Perl. I'll try to dig
if I get a minute to figure out what was the cause and if I need to
patch something.

Also attached is a file with some notes on how I build. The build farm
section isn't finished yet, but there is value in the rest for anyone
doing similar work. If you're wondering how I learned PowerShell, I
didn't. I used AI, forgive me. Eventually I'll have a build animal to
add to the "farm" and update a wiki page somewhere when this solidifies
a bit more. :)

best.

-greg

[1] OS Name Microsoft Windows 11 Pro
Version 10.0.26100 Build 26100
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Name SANTORINI
System Manufacturer Microsoft Corporation
System Model Windows Dev Kit 2023
System Type ARM64-based PC
System SKU 2043
Processor Snapdragon Compute Platform, 2995 Mhz, 8 Core(s), 8 Logical Processor(s)
BIOS Version/Date Microsoft Corporation 13.42.235, 11/13/2024

Attachment Content-Type Size
v2-0001-Address-build-issues-for-ARM64-using-MSVC.patch application/octet-stream 4.6 KB
v2-0002-Fix-Win11-MSVC-ARM64-atomic-intrinsics.patch application/octet-stream 1.6 KB
pg-arm64-notes.txt text/plain 26.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-11-22 22:51:42 Re: POC: Parallel processing of indexes in autovacuum
Previous Message Greg Burd 2025-11-22 21:30:39 Re: Expanding HOT updates for expression and partial indexes