Subject: Re: new mremap(2): relax alignment restrictions?
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 07/30/2007 12:55:31
> However, for things like executables and libraries, that are mapped
> read-only, we'd only have to zero the page if some other process had
> opened the file in write mode since the last time we zero'd it, which
> would probably drop the overhead for those to ~0.
Not only that, but, you don't zero the page; you zero the partial pages
which are after EOF but which are mapped anyway because there is a
partial page before EOF. For normal executables and shared liberaries,
that means you don't zero anything, since they are all page-aligned
maps of page-aligned regions which are wholly backed by the files. The
only overhead in these cases is testing to see whether you need to zero
anything.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B