PageInfo
Gets allowed sizes of virtual memory pages
Linux
Uses directory names in /sys/kernel/mm/hugepages/
to get hugepage sizes andsysconf(_SC_PAGE_SIZE)
to get default page size.
Solaris
Uses getpagesizes() and getpagesize() libc calls.
Windows
Uses GetSystemInfo() to get default pagesize and GetLargePageMinimum()
to get one huge page size. No TLB information is provided.
Constants
HI_PIF_TLBINFO, HI_PIF_DEFAULT, HI_PIF_PAGEINFO, HI_PIF_HUGEPAGE
Page information flags that are saved into pi_flags
field.
VALUES
-
HI_PIF_PAGEINFO - this entry contains page information
-
HI_PIF_TLBINFO - this entry contains TLB information
-
HI_PIF_DEFAULT - this is default pagesize (minimum)
-
HI_PIF_HUGEPAGE - this page is considered "large"
#define HI_PIF_PAGEINFO 0x01 #define HI_PIF_TLBINFO 0x02 #define HI_PIF_DEFAULT 0x04 #define HI_PIF_HUGEPAGE 0x08
Functions
hi_get_pageinfo
publicplat
Get information on supported page sizes by platform
Returns array of hi_page_info_t
structures
Availabilty of most information is platform-dependent, but
this function guarantee to provide correct pagesize for HI_PIF_DEFAULT
pageinfo
TLB information is not provided, but it may be provided by CPUInfo
Returned array is statically allocated, no need to dispose it.
LIBEXPORT PLATAPI hi_page_info_t* hi_get_pageinfo(void)
Types
typedef struct hi_page_info
Information about page supported by processor
MEMBERS
-
pi_flags - flags (see above). If set to 0, this is last entry in array
-
pi_size - size of page in bytes
-
pi_itlb_entries - number of instruction TLB entries
-
pi_dtlb_entries - number of data TLB entries
typedef struct hi_page_info { int pi_flags; size_t pi_size; int pi_itlb_entries; int pi_dtlb_entries; } hi_page_info_t;