aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-09-22 14:01:54 +0200
committerSverker Eriksson <[email protected]>2015-10-01 19:07:26 +0200
commit933bb51d40bcd665602fe4ece951b3111c301e74 (patch)
treed7d2df613f60842857ebfd2aecde6c89356e8b47 /erts/emulator/beam/erl_alloc_util.h
parent5e229f3d7591b0df7d6d475065e1dc2d5273a148 (diff)
downloadotp-933bb51d40bcd665602fe4ece951b3111c301e74.tar.gz
otp-933bb51d40bcd665602fe4ece951b3111c301e74.tar.bz2
otp-933bb51d40bcd665602fe4ece951b3111c301e74.zip
erts: Fix confusion of callbacks destroying_mbc() vs remove_mbc()
Problem #1 Goodfit was crippled by the fact that destroying_mbc() was called _before_ the carriers was unlinked from mbc_list. Problem #2 destroying_mbc() was called for carriers that later could be resurrected from dc_list without a matching call to creating_mbc(). This was mostly a practical problem for the new test case alloc_SUITE:migration that use the callbacks to create/destroy a mutex. Solution: destroying_mbc() is now only called just before a carrier is destroyed (deallocated or put in mseg cache). remove_mbc() is called both (like before) when inserted into cpool but now also when last block is freed and mbc is scheduled for destruction but may later be resurrected from dc_list.
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.h')
-rw-r--r--erts/emulator/beam/erl_alloc_util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h
index df1f0aa65a..f4a2ae7ff3 100644
--- a/erts/emulator/beam/erl_alloc_util.h
+++ b/erts/emulator/beam/erl_alloc_util.h
@@ -277,7 +277,7 @@ typedef struct ErtsDoubleLink_t_ {
typedef struct {
erts_atomic_t next;
erts_atomic_t prev;
- Allctr_t *orig_allctr;
+ Allctr_t *orig_allctr; /* read-only while carrier is alive */
ErtsThrPrgrVal thr_prgr;
erts_atomic_t max_size;
UWord abandon_limit;