Re: Do we need so many hint bits? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Do we need so many hint bits?
Date
Msg-id 14867.1353189211@sss.pgh.pa.us
Whole thread Raw
In response to Re: Do we need so many hint bits?  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Do we need so many hint bits?  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> What's the problem with that? If you already have the VM buffer pinned
> (which should be possible if we keep the VM buffer in a longer-lived
> structure), then doing the test is almost as cheap as checking
> PD_ALL_VISIBLE, because you don't need any locks.

Really?  What about race conditions?  Specifically, I think what you
suggest is likely to be unreliable on machines with weak memory
ordering.  Consider possibility that someone else just changed the VM
bit.  Getting a lock ensures synchronization.  (Yeah, it's possible that
we could use some primitive cheaper than a lock ... but it's not going
to be free.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL
Next
From: Tom Lane
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL