mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
Add TODO to benchmark possibly better policy
This commit is contained in:
parent
6281482c39
commit
db7d99703d
1 changed files with 6 additions and 2 deletions
|
|
@ -130,13 +130,17 @@ sec_multishard_trylock_alloc(
|
||||||
cur_shard = 0;
|
cur_shard = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* No bin had alloc or had the extent */
|
/*
|
||||||
|
* TODO: Benchmark whether it is worth blocking on all shards here before
|
||||||
|
* declaring a miss. That could recover more remote-shard hits under
|
||||||
|
* contention, but it also changes the allocation latency policy.
|
||||||
|
*/
|
||||||
assert(cur_shard == sec_shard_pick(tsdn, sec));
|
assert(cur_shard == sec_shard_pick(tsdn, sec));
|
||||||
bin = sec_bin_pick(sec, cur_shard, pszind);
|
bin = sec_bin_pick(sec, cur_shard, pszind);
|
||||||
malloc_mutex_lock(tsdn, &bin->mtx);
|
malloc_mutex_lock(tsdn, &bin->mtx);
|
||||||
edata_t *edata = sec_bin_alloc_locked(tsdn, sec, bin, size);
|
edata_t *edata = sec_bin_alloc_locked(tsdn, sec, bin, size);
|
||||||
if (edata == NULL) {
|
if (edata == NULL) {
|
||||||
/* Only now we know it is a miss */
|
/* Only now we know it is a miss. */
|
||||||
bin->stats.nmisses++;
|
bin->stats.nmisses++;
|
||||||
}
|
}
|
||||||
malloc_mutex_unlock(tsdn, &bin->mtx);
|
malloc_mutex_unlock(tsdn, &bin->mtx);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue