Re: valgrind versus pg_atomic_init() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: valgrind versus pg_atomic_init()
Date
Msg-id 1096324.1592195162@sss.pgh.pa.us
Whole thread Raw
In response to Re: valgrind versus pg_atomic_init()  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2020-06-14 22:30:25 -0400, Tom Lane wrote:
>> Perhaps it'd be worth putting a memory barrier at the end of the _init
>> function(s)?  As you say, this is hypothetical right now, but that'd be
>> a cheap improvement.

> I don't think it'd be that cheap for some cases. There's an atomic for
> every shared buffer, making their initialization full memory barriers
> would likely be noticable for larger shared_buffers values.

Fair point --- if we did need to do something to make this safer, doing it
at the level of individual atomic values would be the wrong thing anyway.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: valgrind versus pg_atomic_init()
Next
From: Masahiko Sawada
Date:
Subject: Re: vacuum verbose: show pages marked allvisible/frozen/hintbits