Hi d, David McDaniel wrote: > Wondering if anyone knows the reason mmap always returns space 64K aligned on > 32 bit sparc apps. If many small files are mmap'd, lots of address space gets > eaten up. > > Here is what makes sense to me. If there's something I'm missing, let me know.
64k page size is maximum page size (as specified by the ABI of the architecture). So, one sparc may have a 4k byte page size, another sparc may have 8k, and another (non-existent???) sparc may have 64k page sizes. See http://www.sparc.com/standards/psABI3rd.pdf for reference to the Sparc ABI, and search for page size. I think the same is true for x86, but you'll have to find the reference yourself if you're interested. This is a maximum of the minimum page size. Any machine may support larger page sizes as well. By aligning everything on a 64k boundary, you get binary compatibility across machines with different page sizes. So a program compiled on a 4k page machine should run on a machine with a 64k page size, and vice versa. The amount of space lost to rounding everything to 64k is minimal, both in terms of real (at most one page), and virtual (you've got 32 or 64 bits of address, a few 64k extra bytes (per process?). But I should be able to run a program I compiled on a sparc 5 box on an opensolaris sparc box. As far as application code that assumes a particular page alignment, that might not work. > Also, can it be changed via a knob anywhere? As for a knob, yes, probably. There should be a way with the linker (ld), but I've never done it. max > Thanks > -d > _______________________________________________ opensolaris-discuss mailing list [email protected]
