Re: WAL & SHM principles

From: "Ken Hirsch" <kahirsch(at)bellsouth(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL & SHM principles
Date: 2001-03-13 18:04:48
Message-ID: OE584z93XAg0pepP1zn000005cf@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Giles Lean <giles(at)nemeton(dot)com(dot)au> wrote:

> > 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).
>
> mlock() guarantees that the locked address space is in memory. This
> doesn't imply that updates are not written to the backing file.

I've wondered about this myself. It _is_ true on Linux that mlock prevents
writes to the backing store, and this is used as a security feature for
cryptography software. The code for gnupg assumes that if you have mlock()
on any operating system, it does mean this--which doesn't mean it's true,
but perhaps whoever wrote it does have good reason to think so.

But I don't know about other systems. Does anybody know what the POSIX.1b
standard says?

It was even suggested to me on the linux-fsdev mailing list that mlock() was
a good way to insure the write-ahead condition.

Ken Hirsch

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-03-13 18:09:43 Another little xlog change idea
Previous Message Ken Hirsch 2001-03-13 17:38:24 Re: WAL & SHM principles