Re: WAL & SHM principles

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Matthew Kirkwood <matthew(at)hairy(dot)beasts(dot)org>
Cc: Ken Hirsch <kenhirsch(at)myself(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WAL & SHM principles
Date: 2001-03-13 21:21:54
Message-ID: 20010313132153.A29888@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Matthew Kirkwood <matthew(at)hairy(dot)beasts(dot)org> [010313 13:12] wrote:
> On Tue, 13 Mar 2001, Ken Hirsch wrote:
>
> > > 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,
>
> I don't believe that this is true. The manpage offers no
> such promises, and the semantics are not useful.

Afaik FreeBSD's Linux emulator:

revision 1.13
date: 2001/02/28 04:30:27; author: dillon; state: Exp; lines: +3 -1
Linux does not filesystem-sync file-backed writable mmap pages on
a regular basis. Adjust our linux emulation to conform. This will
cause more dirty pages to be left for the pagedaemon to deal with,
but our new low-memory handling code can deal with it. The linux
way appears to be a trend, and we may very well make MAP_NOSYNC the
default for FreeBSD as well (once we have reasonable sequential
write-behind heuristics for random faults).
(will be MFC'd prior to 4.3 freeze)

Suggested by: Andrew Gallatin

Basically any mmap'd data doesn't seem to get sync()'d out on
a regular basis.

> > and this is used as a security feature for cryptography software.
>
> mlock() is used to prevent pages being swapped out. Its
> use for crypto software is essentially restricted to anon
> memory (allocated via brk() or mmap() of /dev/zero).

What about userland device drivers that want to send parts
of a disk backed file to a driver's dma routine?

--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
Daemon News Magazine in your snail-mail! http://magazine.daemonnews.org/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Swan 2001-03-13 21:36:59 Re: Performance monitor signal handler
Previous Message Matthew Kirkwood 2001-03-13 21:10:09 Re: WAL & SHM principles