Expand description
Helpers to calculate values derived from page size.
This has performance benefits from:
- Avoiding calling
sysconf(_SC_PAGESIZE)
multiple times by caching the shift bit. - Using the (faster) shift instruction instead of (slower) multiply/divide instruction.
Constants§
Statics§
- The transparent hugepage size loaded from /sys/kernel/mm/transparent_hugepage/hpage_pmd_size.
Functions§
- The page index of the page which contains the “addr”.
- Converts the bytes to number of pages.
- Returns whether the address/size is aligned with hugepage.
- Returns whether the address/size is aligned with page.
- The head address of the page which contains the “addr”.
- The head address of the page.
- Converts number of pages to byte size.
- Rounds up the address/size with the hugepage size.