Subject: Re: Add a MAP_ALIGNED flag for mmap(2).
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 03/03/2003 16:34:45
>>> 	PMAP_PALIGN	Request page alignment.  The returned region will
>>> 			be page-aligned.
>> Regions returned by mmap are *always* page aligned.
>
>...at present.  But is that part of mmap()'s interface contract, or is
>it an accident of the implementation?
>
>If it's part of the interface contact, it should be documented; if not,
>the above is not, IMO, an appropriate response to the proposed flag.

while you can request a mapping of something that spans only 123
bytes, it will use up a page.  the page is the discrete unit with
which the vm system deals.  if you could deal with smaller units,
those would be called pages.

you can also request a mapping of something 123 bytes into the object.
in that case, you'll get back an address from mmap(2) that's 123 bytes
off from the start of a page, but the entire page is mapped.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."