Avoid eager purging on the dedicated oversize arena when using bg thds.

We have observed new workload patterns (namely ML training type) that cycle
through oversized allocations frequently, because 1) the dataset might be sparse
which is faster to go through, and 2) GPU accelerated.  As a result, the eager
purging from the oversize arena becomes a bottleneck.  To offer an easy
solution, allow normal purging of the oversized extents when background threads
are enabled.
This commit is contained in:
Qi Wang
2023-06-23 14:13:26 -07:00
committed by Qi Wang
parent 46e464a26b
commit d131331310
3 changed files with 42 additions and 25 deletions

View File

@@ -120,7 +120,10 @@ TEST_BEGIN(test_oversize_threshold) {
*/
ptr = mallocx(2 * 1024 * 1024, MALLOCX_ARENA(arena));
dallocx(ptr, MALLOCX_TCACHE_NONE);
expect_zu_ge(max_purged, 2 * 1024 * 1024, "Expected a 2MB purge");
if (!is_background_thread_enabled()) {
expect_zu_ge(max_purged, 2 * 1024 * 1024,
"Expected a 2MB purge");
}
}
TEST_END