pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix the fallback memory barrier implementation to be reentrant.
3+ messages / 2 participants
[nested] [flat]

* pgsql: Fix the fallback memory barrier implementation to be reentrant.
@ 2015-06-26 15:13  Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Andres Freund @ 2015-06-26 15:13 UTC (permalink / raw)
  To: pgsql-committers

Fix the fallback memory barrier implementation to be reentrant.

This was essentially "broken" since 0c8eda62; but until more
recently (14e8803f) barriers usage in signal handlers was infrequent.

The failure to be reentrant was noticed because the test_shm_mq, which
uses memory barriers at a high frequency, occasionally got stuck on some
solaris buildfarm animals. Turns out, those machines use sun studio
12.1, which doesn't yet have efficient memory barrier support. A machine
with a newer sun studio did not fail.  Forcing the barrier fallback to
be used on x86 allows to reproduce the problem.

The new fallback is to use kill(PostmasterPid, 0) based on the theory
that that'll always imply a barrier due to checking the liveliness of
PostmasterPid on systems old enough to need fallback support. It's hard
to come up with a good and performant fallback.

I'm not backpatching this for now - the problem isn't active in the back
branches, and we haven't backpatched barrier changes for
now. Additionally master looks entirely different than the back branches
due to the new atomics abstraction. It seems better to let this rest in
master, where the non-reentrancy actively causes a problem, and then
consider backpatching.

Found-By: Robert Haas
Discussion: 55626265.3060800@dunslane.net

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1b468a131bd260c9041484f78b8580c7f232d580

Modified Files
--------------
src/backend/port/atomics.c |   21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Fix the fallback memory barrier implementation to be reentrant.
@ 2015-06-28 22:42  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2015-06-28 22:42 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-committers

Andres Freund <andres@anarazel.de> writes:
> Fix the fallback memory barrier implementation to be reentrant.

Seems this has not done the trick: anole just crashed with "stuck
spinlock" again.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Fix the fallback memory barrier implementation to be reentrant.
@ 2015-06-29 10:02  Andres Freund <andres@anarazel.de>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Andres Freund @ 2015-06-29 10:02 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

On 2015-06-28 18:42:55 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Fix the fallback memory barrier implementation to be reentrant.
>
> Seems this has not done the trick: anole just crashed with "stuck
> spinlock" again.

Hopefully it fixed protosciurus and castoroides though, that had
different symptoms.

Looking into anole specifically.


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-06-29 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 15:13 pgsql: Fix the fallback memory barrier implementation to be reentrant. Andres Freund <andres@anarazel.de>
2015-06-28 22:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-06-29 10:02   ` Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox