Subject: Re: new mremap(2): relax alignment restrictions?
To: None <tech-kern@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 07/30/2007 11:14:33
On Tue, Jul 24, 2007 at 05:15:31PM -0500, Eric Haszlakiewicz wrote:
>  if you map a 10 byte file (for example), the mmap man page says that
> the mapped region may be extended up to the page size.
>   I suppose there's a bit of a performance hit with zeroing out the page
> every time, but it seems like a necessary thing to do.  A couple other
> OSes I've tried it on do so.

This discussion is lame. There are four possible approaches to this
problem:
(1) Discontinue UCB. Inacceptible as it introduces far more issues than
it is worth.
(2) Zero the page at random times (e.g. scheduling). Doesn't fix the
issue, just makes the window smaller.
(3) Trap on write. Horrible performance, MP issues.
(4) Disallow mmap for write on not page-sized files. Standard compliance
issues.

So of all the options, ignoring the issue is the only really acceptable
choice IMO.

Joerg