mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-25 01:57:20 +03:00
HPA: Make slab sizes and maxes configurable.
This allows easy experimentation with them as tuning parameters.
This commit is contained in:
parent
1c7da33317
commit
bf025d2ec8
7 changed files with 37 additions and 10 deletions
15
src/pa.c
15
src/pa.c
|
|
@ -48,13 +48,14 @@ pa_shard_init(tsdn_t *tsdn, pa_shard_t *shard, emap_t *emap, base_t *base,
|
|||
}
|
||||
|
||||
bool
|
||||
pa_shard_enable_hpa(pa_shard_t *shard, hpa_t *hpa) {
|
||||
/*
|
||||
* These are constants for now; eventually they'll probably be
|
||||
* tuneable.
|
||||
*/
|
||||
size_t ps_goal = 512 * 1024;
|
||||
size_t ps_alloc_max = 256 * 1024;
|
||||
pa_shard_enable_hpa(pa_shard_t *shard, hpa_t *hpa, size_t ps_goal,
|
||||
size_t ps_alloc_max) {
|
||||
ps_goal &= ~PAGE_MASK;
|
||||
ps_alloc_max &= ~PAGE_MASK;
|
||||
|
||||
if (ps_alloc_max > ps_goal) {
|
||||
ps_alloc_max = ps_goal;
|
||||
}
|
||||
if (hpa_shard_init(&shard->hpa_shard, hpa, &shard->edata_cache,
|
||||
shard->ind, ps_goal, ps_alloc_max)) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue