Re: spin_delay() for ARM - Mailing list pgsql-hackers

From Tom Lane
Subject Re: spin_delay() for ARM
Date
Msg-id 31850.1586550129@sss.pgh.pa.us
Whole thread Raw
In response to Re: spin_delay() for ARM  (Andres Freund <andres@anarazel.de>)
Responses Re: spin_delay() for ARM
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2020-04-10 13:09:13 +0530, Amit Khandekar wrote:
>> On my Intel Xeon machine with 8 cores, I tried to test PAUSE also
>> using a sample C program (attached spin.c).

> PAUSE doesn't operate on the level of the CPU scheduler. So the OS won't
> just schedule another process - you won't see different CPU usage if you
> measure it purely as the time running. You should be able to see a
> difference if you measure with a profiler that shows you data from the
> CPUs performance monitoring unit.

A more useful test would be to directly experiment with contended
spinlocks.  As I recall, we had some test cases laying about when
we were fooling with the spin delay stuff on Intel --- maybe
resurrecting one of those would be useful?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Properly mark NULL returns in numeric aggregates
Next
From: Tom Lane
Date:
Subject: Re: pg_dump issue with renamed system schemas