Re: Add spin_delay() implementation for Arm in s_lock.h - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add spin_delay() implementation for Arm in s_lock.h
Date
Msg-id 1275075.1641525818@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add spin_delay() implementation for Arm in s_lock.h  (Andres Freund <andres@anarazel.de>)
Responses Re: Add spin_delay() implementation for Arm in s_lock.h
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> These separate shm_mq instances forward messages in a circle,
> "leader"->worker_1->worker_2->...->"leader". So there isn't a single contended
> spinlock, but a bunch of different spinlocks, each with at most two backends
> accessing it?

No; there's just one spinlock.  I'm re-purposing the spinlock that
test_shm_mq uses to protect its setup operations (and thereafter
ignores).  AFAICS the N+1 shm_mq instances don't internally contain
spinlocks; they all use atomic ops.

(Well, on crappy architectures maybe there's spinlocks underneath
the atomic ops, but I don't think we care about such cases here.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Add spin_delay() implementation for Arm in s_lock.h
Next
From: Lukas Fittl
Date:
Subject: Re: [PATCH] Add extra statistics to explain for Nested Loop