mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-19 03:16:22 +03:00
Check if the huge page size is expected when enabling HPA.
This commit is contained in:
parent
cd05b19f10
commit
3383b98f1b
2 changed files with 29 additions and 7 deletions
|
|
@ -27,6 +27,14 @@ extern size_t os_page;
|
|||
#define HUGEPAGE ((size_t)(1U << LG_HUGEPAGE))
|
||||
#define HUGEPAGE_MASK ((size_t)(HUGEPAGE - 1))
|
||||
|
||||
/*
|
||||
* Used to validate that the hugepage size is not unexpectedly high. The huge
|
||||
* page features (HPA, metadata_thp) are primarily designed with a 2M THP size
|
||||
* in mind. Much larger sizes are not tested and likely to cause issues such as
|
||||
* bad fragmentation or simply broken.
|
||||
*/
|
||||
#define HUGEPAGE_MAX_EXPECTED_SIZE ((size_t)(16U << 20))
|
||||
|
||||
#if LG_HUGEPAGE != 0
|
||||
# define HUGEPAGE_PAGES (HUGEPAGE / PAGE)
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue