remove pg_spin_delay() from atomics code

Started by Nathan Bossart7 months ago4 messageshackers
Jump to latest
#1Nathan Bossart
nathandbossart@gmail.com

While inspecting what 32-bit optimizations we had, I noticed this line in
atomics/arch-x86.h:

#elif defined(_MSC_VER) && defined(__x86_64__)

...which led me to rediscover what Thomas Munro had found a while back [0]/messages/by-id/CA+hUKGL8Hs-phHPugrWM=5dAkcT897rXyazYzLw-Szxnzgx-rA@mail.gmail.com,
i.e., we aren't using the right x86_64 macro for MSVC in lots of places.
Upon further inspection, all of this pg_spin_delay() stuff seems to have
been unused since it was added in commit b64d92f1a5, so I'm guessing it's
just an implementation artifact that didn't get cleaned up.

Here's a patch to remove that dead code.

[0]: /messages/by-id/CA+hUKGL8Hs-phHPugrWM=5dAkcT897rXyazYzLw-Szxnzgx-rA@mail.gmail.com

--
nathan

Attachments:

v1-0001-remove-pg_spin_delay.patchtext/plain; charset=us-asciiDownload+0-66
#2Corey Huinker
corey.huinker@gmail.com
In reply to: Nathan Bossart (#1)
Re: remove pg_spin_delay() from atomics code

Here's a patch to remove that dead code.

+1

The patch removes all 0 usages of pg_spin_delay, and all mentions of
pg_spin_delay.

All the associated comments were removed, no more, no less.

Deleted code is debugged code.

#3Nathan Bossart
nathandbossart@gmail.com
In reply to: Corey Huinker (#2)
Re: remove pg_spin_delay() from atomics code

On Wed, May 27, 2026 at 02:37:56AM -0400, Corey Huinker wrote:

+1

The patch removes all 0 usages of pg_spin_delay, and all mentions of
pg_spin_delay.

All the associated comments were removed, no more, no less.

Deleted code is debugged code.

Thanks for looking. FWIW I'm planning to wait until v20 opens for
development before committing this. That's probably unnecessary, but I see
no advantage to rushing.

--
nathan

#4Nathan Bossart
nathandbossart@gmail.com
In reply to: Nathan Bossart (#3)
Re: remove pg_spin_delay() from atomics code

Committed.

--
nathan