mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-25 06:13:13 +00:00
Disable psset test when hugepage size is too large.
This commit is contained in:
@@ -151,6 +151,7 @@ struct hpa_shard_s {
|
|||||||
nstime_t last_purge;
|
nstime_t last_purge;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool hpa_hugepage_size_exceeds_limit();
|
||||||
/*
|
/*
|
||||||
* Whether or not the HPA can be used given the current configuration. This is
|
* Whether or not the HPA can be used given the current configuration. This is
|
||||||
* is not necessarily a guarantee that it backs its allocations by hugepages,
|
* is not necessarily a guarantee that it backs its allocations by hugepages,
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ static void hpa_dalloc_batch(tsdn_t *tsdn, pai_t *self,
|
|||||||
edata_list_active_t *list, bool *deferred_work_generated);
|
edata_list_active_t *list, bool *deferred_work_generated);
|
||||||
static uint64_t hpa_time_until_deferred_work(tsdn_t *tsdn, pai_t *self);
|
static uint64_t hpa_time_until_deferred_work(tsdn_t *tsdn, pai_t *self);
|
||||||
|
|
||||||
|
bool
|
||||||
|
hpa_hugepage_size_exceeds_limit() {
|
||||||
|
return HUGEPAGE > HUGEPAGE_MAX_EXPECTED_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
hpa_supported(void) {
|
hpa_supported(void) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -52,7 +57,7 @@ hpa_supported(void) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* As mentioned in pages.h, do not support If HUGEPAGE is too large. */
|
/* As mentioned in pages.h, do not support If HUGEPAGE is too large. */
|
||||||
if (HUGEPAGE > HUGEPAGE_MAX_EXPECTED_SIZE) {
|
if (hpa_hugepage_size_exceeds_limit()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ edata_expect(edata_t *edata, size_t page_offset, size_t page_cnt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_BEGIN(test_empty) {
|
TEST_BEGIN(test_empty) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
hpdata_t pageslab;
|
hpdata_t pageslab;
|
||||||
hpdata_init(&pageslab, PAGESLAB_ADDR, PAGESLAB_AGE);
|
hpdata_init(&pageslab, PAGESLAB_ADDR, PAGESLAB_AGE);
|
||||||
@@ -137,6 +138,7 @@ TEST_BEGIN(test_empty) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_fill) {
|
TEST_BEGIN(test_fill) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
|
|
||||||
hpdata_t pageslab;
|
hpdata_t pageslab;
|
||||||
@@ -169,6 +171,7 @@ TEST_BEGIN(test_fill) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_reuse) {
|
TEST_BEGIN(test_reuse) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
hpdata_t *ps;
|
hpdata_t *ps;
|
||||||
|
|
||||||
@@ -261,6 +264,7 @@ TEST_BEGIN(test_reuse) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_evict) {
|
TEST_BEGIN(test_evict) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
hpdata_t *ps;
|
hpdata_t *ps;
|
||||||
|
|
||||||
@@ -295,6 +299,7 @@ TEST_BEGIN(test_evict) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_multi_pageslab) {
|
TEST_BEGIN(test_multi_pageslab) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
hpdata_t *ps;
|
hpdata_t *ps;
|
||||||
|
|
||||||
@@ -420,6 +425,7 @@ TEST_END
|
|||||||
|
|
||||||
TEST_BEGIN(test_stats_huge) {
|
TEST_BEGIN(test_stats_huge) {
|
||||||
test_skip_if(!config_stats);
|
test_skip_if(!config_stats);
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
|
|
||||||
hpdata_t pageslab;
|
hpdata_t pageslab;
|
||||||
hpdata_init(&pageslab, PAGESLAB_ADDR, PAGESLAB_AGE);
|
hpdata_init(&pageslab, PAGESLAB_ADDR, PAGESLAB_AGE);
|
||||||
@@ -542,6 +548,7 @@ stats_expect(psset_t *psset, size_t nactive) {
|
|||||||
|
|
||||||
TEST_BEGIN(test_stats_fullness) {
|
TEST_BEGIN(test_stats_fullness) {
|
||||||
test_skip_if(!config_stats);
|
test_skip_if(!config_stats);
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
|
|
||||||
bool err;
|
bool err;
|
||||||
|
|
||||||
@@ -637,6 +644,7 @@ init_test_pageslabs(psset_t *psset, hpdata_t *pageslab,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_BEGIN(test_oldest_fit) {
|
TEST_BEGIN(test_oldest_fit) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
edata_t alloc[HUGEPAGE_PAGES];
|
edata_t alloc[HUGEPAGE_PAGES];
|
||||||
edata_t worse_alloc[HUGEPAGE_PAGES];
|
edata_t worse_alloc[HUGEPAGE_PAGES];
|
||||||
@@ -660,6 +668,7 @@ TEST_BEGIN(test_oldest_fit) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_insert_remove) {
|
TEST_BEGIN(test_insert_remove) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
bool err;
|
bool err;
|
||||||
hpdata_t *ps;
|
hpdata_t *ps;
|
||||||
edata_t alloc[HUGEPAGE_PAGES];
|
edata_t alloc[HUGEPAGE_PAGES];
|
||||||
@@ -706,6 +715,7 @@ TEST_BEGIN(test_insert_remove) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_purge_prefers_nonhuge) {
|
TEST_BEGIN(test_purge_prefers_nonhuge) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
/*
|
/*
|
||||||
* All else being equal, we should prefer purging non-huge pages over
|
* All else being equal, we should prefer purging non-huge pages over
|
||||||
* huge ones for non-empty extents.
|
* huge ones for non-empty extents.
|
||||||
@@ -789,6 +799,7 @@ TEST_BEGIN(test_purge_prefers_nonhuge) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_purge_prefers_empty) {
|
TEST_BEGIN(test_purge_prefers_empty) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
psset_t psset;
|
psset_t psset;
|
||||||
@@ -825,6 +836,7 @@ TEST_BEGIN(test_purge_prefers_empty) {
|
|||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_purge_prefers_empty_huge) {
|
TEST_BEGIN(test_purge_prefers_empty_huge) {
|
||||||
|
test_skip_if(hpa_hugepage_size_exceeds_limit());
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
psset_t psset;
|
psset_t psset;
|
||||||
|
|||||||
Reference in New Issue
Block a user