User: Password:
|
|
Subscribe / Log in / New account

Why add anything?

Why add anything?

Posted Mar 30, 2007 23:19 UTC (Fri) by giraffedata (subscriber, #1954)
In reply to: Why add anything? by mjr
Parent article: Application-friendly kernel interfaces

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.


(Log in to post comments)

Why add anything?

Posted Apr 5, 2007 14:15 UTC (Thu) by farnz (subscriber, #17727) [Link]

Might be worth looking at Linux-mm.org on huge pages. In particular, there's a link to an LWM article on transparent use of huge pages. The "holy grail" is very definitely transparent use, so that whenever possible, all applications gain; anything that makes it easier to move that way is helpful.

One thought; if your mmap parameter is simply a hint that the block will be used in a particular granularity, it's easy to implement. Current mmap sets the parameter to 1 byte (no granularity needed), unless mmaping in hugetlbfs pages, when it sets the parameter to (e.g.) 16M. The kernel then just rounds up to the next highest available page size when possible, or down if not.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds