Reputation: 415
I was trying to understand Transparent Huge Page and came across Anonymous Memory mapping. What is Anonymous memory mapping and why Transparent Huge Page is supported only for that type?
Upvotes: 0
Views: 188
Reputation: 781058
Anonymous memory mapping is a memory mapping that isn't associated with a file. See What is the purpose of MAP_ANONYMOUS flag in mmap system call? for more details about it.
Anonymous mappings are often used to implement the heap and stack used by application languages. So by enabling THP for anonymous mappings, it allows for very large heaps, which allows applications to process huge amounts of data.
Most applications don't use memory mapping to access files, they use system calls like open
, read
, and write
. So there's less need to use huge pages with mapped files, and they haven't implemented this.
Upvotes: 1