I can see the value of using mmap() for this, but I don't think you want mmap() guessing based on the size of the request what page size is best.
It's quite possible that 16M of memory will consist of 100 scattered 4K pages of working set and the rest rarely used or even vacant. You wouldn't want to page the whole 16M in and out in that case.
Page granularity seems like a perfectly sensible parameter of an mmap, though.
Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds