Re: valgrind versus pg_atomic_init()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: valgrind versus pg_atomic_init()
Date: 2020-06-15 04:26:02
Message-ID: 1096324.1592195162@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-06-15 04:30:58 Re: vacuum verbose: show pages marked allvisible/frozen/hintbits
Previous Message Andres Freund 2020-06-15 04:19:04 Re: valgrind versus pg_atomic_init()