aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_hash.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-05-15 17:26:42 +0200
committerSverker Eriksson <[email protected]>2019-07-05 15:25:07 +0200
commitbfee94fedd39eedd6f27b125461568fd4ceba336 (patch)
tree4f1952c05a0ba4e4b1c7586a74b743ef27dc30ef /erts/emulator/beam/erl_db_hash.h
parent4172488e16506ecbf9d66a0fd55a4a91a205e66d (diff)
downloadotp-bfee94fedd39eedd6f27b125461568fd4ceba336.tar.gz
otp-bfee94fedd39eedd6f27b125461568fd4ceba336.tar.bz2
otp-bfee94fedd39eedd6f27b125461568fd4ceba336.zip
erts: Tweak hash shrink limit
* Only shrink when we can remove one segment and still remain below 50% table load. * Only shrink down to two table segments. It just leads to a lot of potentially "unnecessary" rehashing to have a chance of getting rid of the last extra segment before the last delete op. I don't think it's worth it.
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.h')
-rw-r--r--erts/emulator/beam/erl_db_hash.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_db_hash.h b/erts/emulator/beam/erl_db_hash.h
index eae5537ba4..ecd2ca74a1 100644
--- a/erts/emulator/beam/erl_db_hash.h
+++ b/erts/emulator/beam/erl_db_hash.h
@@ -63,9 +63,10 @@ typedef struct db_table_hash_fine_locks {
typedef struct db_table_hash {
DbTableCommon common;
- /* SMP: szm and nactive are write-protected by is_resizing or table write lock */
+ /* szm, nactive, shrink_limit are write-protected by is_resizing or table write lock */
erts_atomic_t szm; /* current size mask. */
erts_atomic_t nactive; /* Number of "active" slots */
+ erts_atomic_t shrink_limit; /* Shrink table when fewer objects than this */
erts_atomic_t segtab; /* The segment table (struct segment**) */
struct segment* first_segtab[1];