Re: [PATCH] Native spinlock support on RISC-V - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Native spinlock support on RISC-V
Date
Msg-id 78751.1628876222@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Native spinlock support on RISC-V  ("Andres Freund" <andres@anarazel.de>)
Responses Re: [PATCH] Native spinlock support on RISC-V  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
"Andres Freund" <andres@anarazel.de> writes:
> On Fri, Aug 13, 2021, at 19:25, Tom Lane wrote:
>> I now have looked at the patch, and it seems good as far as it goes,
>> but I wonder whether some effort ought to be expended in
>> src/include/port/atomics/.

> That should automatically pick up the intrinsic. I think we should do the same on modern compilers for spinlocks, but
that'sa separate discussion I guess. 

I was looking at the comment in atomics.h about

 * Provide a full fallback of the pg_*_barrier(), pg_atomic**_flag and
 * pg_atomic_* APIs for platforms without sufficient spinlock and/or atomics
 * support. In the case of spinlock backed atomics the emulation is expected
 * to be efficient, although less so than native atomics support.

so it seems like someday we might want to expend some effort on native
atomics.  I agree that that day need not be today, though.  This patch
seems sufficient until we get to the point of (at least) having some
RISC-V in the buildfarm.

            regards, tom lane



pgsql-hackers by date:

Previous
From: "Andres Freund"
Date:
Subject: Re: [PATCH] Native spinlock support on RISC-V
Next
From: Andres Freund
Date:
Subject: Re: [PATCH] Native spinlock support on RISC-V