NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mmap and MAP_FIXED



Hello,

On Thu, 12 May 2016 11:26:08 +0200
Johnny Billquist <bqt%update.uu.se@localhost> wrote:

> I haven't tested, or analyzed this to any depth, but I wonder... What is 
> the pagesize of the machine? 8K? I wonder if you might have some issue 
> when you try to map only 4K fixed. The man-page says that if MAP_FIXED 
> is used, the address must be page aligned, but it does not say anything 
> about the size, but it makes me wonder...

Page size is hardware dependent, I have machines here that use 4K
( sparc, powerpc, etc. ), 8K ( sparc64, arm ) or 16K ( some MIPS )
pages.
But the start address in the test program is aligned to something much
larger, so the first test should succeed if that was the problem. I
wouldn't bet on the address range used being available though, but
that's just a hunch.
Also, why MMAP_FIXED in the first place?
Finally, mmap()ing 1TB will probably run into all sorts of other
problems before hitting mmap() itself. If the underlying filesystem is
ffsv1 it probably doesn't even support files that big.

have fun
Michael




Home | Main Index | Thread Index | Old Index