Re: WAL & SHM principles

Поиск
Список
Период
Сортировка
От Martin Devera
Тема Re: WAL & SHM principles
Дата
Msg-id Pine.LNX.4.10.10103121222220.11948-100000@luxik.cdi.cz
обсуждение исходный текст
Ответ на Re: WAL & SHM principles  (Giles Lean <giles@nemeton.com.au>)
Список pgsql-hackers
> > When you mmap, you don't use write() !  mlock actualy locks page in
> > memory and as long as the page is locked the OS doesn't attempt to
> > store the dirty page.  It is intended also for security app to
> > ensure that sensitive data are not written to unsecure storage
> > (hdd). It is definition of mlock so that you can be probably sure
> > with it.
> 
> News to me ... can you please point to such a definition?  I see no
> reference to such semantics in the mlock() manual page in UNIX98
> (Single Unix Standard, version 2).

sorry, maybe I'm biased toward Linux. The statement above is from Linux's
man page and as I looked into mm code it seems to be right.
I'm not sore about other unices.

> mlock() guarantees that the locked address space is in memory.  This
> doesn't imply that updates are not written to the backing file.

yes, probably it depends on OS in question. In Linux kernel the page is
not written when mlocked (but I'm not sure about msync here).

> I would expect an OS that doesn't have a unified buffer cache but
> tries to keep a consistent view for mmap() and read()/write() to
> update the file.

hmm but why to mlock page then ? Only to be sure the page is not wsapped
out ?

regards, devik



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: pg_upgrade
Следующее
От: Karel Zak
Дата:
Сообщение: /contrib 'cosmetic'