mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 13:13:06 +00:00
Limit maximum number of purged slabs with option
Option `experimental_hpa_max_purge_nhp` introduced for backward compatibility reasons: to make it possible to have behaviour similar to buggy `hpa_strict_min_purge_interval` implementation. When `experimental_hpa_max_purge_nhp` is set to -1, there is no limit to number of slabs we'll purge on each iteration. Otherwise, we'll purge no more than `experimental_hpa_max_purge_nhp` hugepages (slabs). This in turn means we might not purge enough dirty pages to satisfy `hpa_dirty_mult` requirement. Combination of `hpa_dirty_mult`, `experimental_hpa_max_purge_nhp` and `hpa_strict_min_purge_interval` options allows us to have steady rate of pages returned back to the system. This provides a strickier latency guarantees as number of `madvise` calls is bounded (and hence number of TLB shootdowns is limited) in exchange to weaker memory usage guarantees.
This commit is contained in:
@@ -57,6 +57,11 @@ struct hpa_shard_opts_s {
|
||||
* purging logic fix.
|
||||
*/
|
||||
bool strict_min_purge_interval;
|
||||
|
||||
/*
|
||||
* Maximum number of hugepages to purge on each purging attempt.
|
||||
*/
|
||||
ssize_t experimental_max_purge_nhp;
|
||||
};
|
||||
|
||||
#define HPA_SHARD_OPTS_DEFAULT { \
|
||||
@@ -79,7 +84,9 @@ struct hpa_shard_opts_s {
|
||||
/* min_purge_interval_ms */ \
|
||||
5 * 1000, \
|
||||
/* strict_min_purge_interval */ \
|
||||
false \
|
||||
false, \
|
||||
/* experimental_max_purge_nhp */ \
|
||||
-1 \
|
||||
}
|
||||
|
||||
#endif /* JEMALLOC_INTERNAL_HPA_OPTS_H */
|
||||
|
||||
Reference in New Issue
Block a user