Re: Shortcoming in CLOBBER_FREED_MEMORY coverage: disk buffer pointers

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Shortcoming in CLOBBER_FREED_MEMORY coverage: disk buffer pointers
Дата
Msg-id 54C6D5B6.4060902@BlueTreble.com
обсуждение исходный текст
Ответ на Re: Shortcoming in CLOBBER_FREED_MEMORY coverage: disk buffer pointers  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Shortcoming in CLOBBER_FREED_MEMORY coverage: disk buffer pointers  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
On 1/26/15 4:51 PM, Tom Lane wrote:
> Jim Nasby <Jim.Nasby@bluetreble.com> writes:
>> On 1/24/15 3:31 PM, Tom Lane wrote:
>>> Another idea is to teach Valgrind that whenever a backend reduces its
>>> pin count on a shared buffer to zero, that buffer should become undefined
>>> memory.
>
>> <paranoia>
>
>> Shouldn't this technically tie in with ResourceOwners?
>
> No.  ResourceOwner is just a mechanism to ensure that we remember to call
> UnpinBuffer, it has no impact on what the semantics of the pin count are.
> The *instant* the pin count goes to zero, another backend is entitled to
> recycle that buffer for some other purpose.

But one backend can effectively "pin" a buffer more than once, no? If so, then ISTM there's some risk that code path A
pinsand forgets to unpin, but path B accidentally unpins for A.
 

But as you say, this is all academic until the pin count hits 0, so it's probably not worth worrying about.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Re: Abbreviated keys for Numeric
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: pg_upgrade and rsync