Re: BufFreelistLock

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: BufFreelistLock
Дата
Msg-id 0449DD6E-83E9-445B-8850-8F3402C1CF56@nasby.net
обсуждение исходный текст
Ответ на Re: BufFreelistLock  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: BufFreelistLock  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
On Dec 8, 2010, at 11:44 PM, Jeff Janes wrote:
>>> For the clock sweep algorithm, I think you could access
>>> nextVictimBuffer without any type of locking.
>>
>> This is wrong, mainly because you wouldn't have any security against two
>> processes decrementing the usage count of the same buffer because they'd
>> fetched the same value of nextVictimBuffer.  That would probably happen
>> often enough to severely compromise the accuracy of the usage counts and
>> thus the accuracy of the LRU eviction behavior.  See above.
>
> Ah, I hadn't considered that.

Ideally, the clock sweep would be run by bgwriter and not individual backends. In that case it shouldn't matter much
whatthe performance of the sweep is. To do that I think we'd want the bgwriter to target there being X number of
bufferson the free list instead of (or in addition to) targeting how many dirty buffers need to be written. This would
mirrorwhat operating systems do; they strive to keep X number of pages on the free list so that when a process needs
memoryit can get it quickly. 
--
Jim C. Nasby, Database Architect                   jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net




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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Patch to add a primary key using an existing index
Следующее
От: Tom Lane
Дата:
Сообщение: Re: initdb failure with Postgres 8.4.4