On Mon, 1 Mar 2010 22:56:55 +0000, Sad Clouds <cryintotheblue...@googlemail.com> wrote: > Solaris mmap man page states that the system adds two 8K 'red zone' > pages to each mapping and then rounds the total mapping to some > multiple.
2 * PAGESIZE actually, for a total of 8K. > > Because of the above, applications that need to mmap power of 2 > memory segments will end up wasting large amounts of virtual address > space. > > This design seems to be a bit of an oversight, i.e. mapping red zone > pages should be an option when calling mmap, because not all > applications need it. This wasteful for lots of small mappings (power of two or otherwise) which will always use at least 3 pages. If you have lots of tiny anon maps you probably want to use a userspace memory allocator instead. For larger mappings the manual states that the maximum rounding is to a multiple of of 4M, so you'll lose at most 4M for mappings >= 4M. Even though this adds adjacent sparsely populated segments to the page table, the VM structures ought to deal well with sparse mappings. > > Is there a way to force mmap not to map red zone pages? A system > tunable? This has been suggested before: http://www.opensolaris.org/jive/thread.jspa?messageID=111304𛦟 but currently no mechanism exists. -Albert _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code