Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)

From: Andres Freund <andres(at)anarazel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)
Date: 2020-06-16 01:37:17
Message-ID: 20200616013717.7qfplkk5yhxopzhc@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2020-06-09 17:04:42 -0400, Robert Haas wrote:
> On Tue, Jun 9, 2020 at 3:37 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > Hm. Looking at this again, perhaps the better fix would be to simply not
> > look at the concrete values of the barrier inside the signal handler?
> > E.g. we could have a new PROCSIG_GLOBAL_BARRIER, which just triggers
> > ProcSignalBarrierPending to be set. And then have
> > ProcessProcSignalBarrier do the check that's currently in
> > CheckProcSignalBarrier()?
>
> That seems like a good idea.

What do you think about 0002?

With regard to the cost of the expensive test in 0003, I'm somewhat
inclined to add that to the buildfarm for a few days and see how it
actually affects the few bf animals without atomics. We can rip it out
after we got some additional coverage (or leave it in if it turns out to
be cheap enough in comparison).

> Also, I wonder if someone would be willing to set up a BF animal for this.

FWIW, I've requested a buildfarm animal id for this a few days ago, but
haven't received a response yet...

Greetings,

Andres Freund

Attachment Content-Type Size
v1-0001-spinlock-emulation-Fix-bug-when-more-than-INT_MAX.patch text/x-diff 1.0 KB
v1-0002-Avoid-potential-spinlock-use-inside-a-signal-hand.patch text/x-diff 6.8 KB
v1-0003-Add-basic-spinlock-tests-to-regression-tests.patch text/x-diff 3.9 KB
v1-0004-Fix-deadlock-danger-when-atomic-ops-are-done-unde.patch text/x-diff 7.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2020-06-16 02:33:42 Re: Failures with wal_consistency_checking and 13~
Previous Message Michael Paquier 2020-06-16 01:02:21 Re: 回复:回复:how to create index concurrently on partitioned table