Re: Linux max on shared buffers?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Linux max on shared buffers?
Дата
Msg-id 20032.1027171329@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Linux max on shared buffers?  (Curt Sampson <cjs@cynic.net>)
Список pgsql-general
Curt Sampson <cjs@cynic.net> writes:
> You can always do an msync to force a block out. But I don't think
> you'd ever bother; the transaction log is the only thing for which
> you need to force writes,

This is completely wrong.  One of the fatal problems with mmap is that
there's no equivalent of sync(), but only fsync --- a process can only
msync those mmap regions that it has itself got mmap'd.  That means that
CHECKPOINT doesn't work, because it has no way to force out all
currently dirty data blocks before placing a "checkpoint done" record
in WAL.  You could perhaps get around that with centralized control of
mmap'ing, but at that point you've just got a klugy, not-very-portable
reimplementation of the existing shared buffer manager.

> Sure. For that, you can just mmap an anonymous memory area and share it
> amongst all your processes, or use sysv shared memory.

AFAICS the only thing we'll ever use mmap for is as a direct substitute
for SYSV shared memory on platforms that haven't got it.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Linux max on shared buffers?
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Linux max on shared buffers?