File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,22 @@ let buf = &mut [0u8; 5];
122122let result = guest_memory_mmap . write (buf , addr );
123123```
124124
125+ #### Page Size Policy
126+
127+ For regions backed by a call to ` mmap ` , the user may specify the desired page size
128+ and behavior expected by the operating system. The current options include:
129+
130+ - ` BasePages ` : The standard page size provided by the operating system.
131+ - ` TransparentHugepages ` : (Implemented only for Unix-like systems) Hints to the operating
132+ system that base pages can be combined transparently into larger page sizes. Concretely,
133+ mappings with this policy will invoke ` madvise ` with the ` MADV_HUGEPAGE ` flag.
134+ - ` ExplicitHugepages ` : Requests that the entire mapping be explicitly mapped to a pre-reserved
135+ pool of hugepages. Concretely, mappings with this policy will include the ` MAP_HUGETLB ` flag
136+ in the call to ` mmap ` . ** NOTE:** If the operating system has no available hugepages (e.g. on Linux,
137+ if ` cat /proc/sys/vm/nr_hugepages ` reads 0), then the mapping, or attempts to dereference addresses
138+ within the region, may fail. It is the responsibility of the VMM to ensure that hugepages are
139+ available for use before constructing a mapping with this policy.
140+
125141### Utilities and Helpers
126142
127143The following utilities and helper traits/macros are imported from the
You can’t perform that action at this time.
0 commit comments