aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_gc.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-02-02 17:17:46 +0100
committerLukas Larsson <[email protected]>2016-02-02 17:17:46 +0100
commit246927d866b7de938cc58c95498f54b03869cbe5 (patch)
tree63c4846a861aec6051b4f31aa1c5f5186802855a /erts/emulator/beam/erl_gc.c
parentf45b817d0da8f9f61d2241d4f0eb06e47a6be86a (diff)
parentf12da3c4abe70bd932484895af6e23436b308f53 (diff)
downloadotp-246927d866b7de938cc58c95498f54b03869cbe5.tar.gz
otp-246927d866b7de938cc58c95498f54b03869cbe5.tar.bz2
otp-246927d866b7de938cc58c95498f54b03869cbe5.zip
Merge branch 'lukas/erts/msacc'
* lukas/erts/msacc: Update preloaded modules erts: Make msacc alloctor type thread safe Silence compiler erts: Fix msacc testcase on some windowses erts: Add power saving cpu feature tests and use them erts: Refactor perf counter internal interface erts: Add rdtscp instruction check erts: Fix hrtime for windows erts: use correct function for perf counter on non-x86 erts: Fix msacc win32 debug compile error erts: Add microstate accounting erts, kernel: Add os:perf_counter function erts: Add ERTS_WRITE_UNLIKELY
Diffstat (limited to 'erts/emulator/beam/erl_gc.c')
-rw-r--r--erts/emulator/beam/erl_gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 06acece471..21b03ae8bd 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -576,6 +576,7 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
int reds;
ErtsMonotonicTime start_time = 0; /* Shut up faulty warning... */
ErtsSchedulerData *esdp;
+ ERTS_MSACC_PUSH_STATE_M();
#ifdef USE_VM_PROBES
DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
#endif
@@ -588,6 +589,8 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
else if (p->live_hf_end != ERTS_INVALID_HFRAG_PTR)
live_hf_end = p->live_hf_end;
+ ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_GC);
+
esdp = erts_get_scheduler_data();
if (IS_TRACED_FL(p, F_TRACE_GC)) {
@@ -624,9 +627,11 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
}
else {
do_major_collection:
+ ERTS_MSACC_SET_STATE_CACHED_M_X(ERTS_MSACC_STATE_GC_FULL);
DTRACE2(gc_major_start, pidbuf, need);
reds = major_collection(p, live_hf_end, need, objv, nobj, &reclaimed_now);
DTRACE2(gc_major_end, pidbuf, reclaimed_now);
+ ERTS_MSACC_SET_STATE_CACHED_M_X(ERTS_MSACC_STATE_GC);
}
reset_active_writer(p);
@@ -669,6 +674,8 @@ garbage_collect(Process* p, ErlHeapFragment *live_hf_end,
FLAGS(p) &= ~F_FORCE_GC;
p->live_hf_end = ERTS_INVALID_HFRAG_PTR;
+ ERTS_MSACC_POP_STATE_M();
+
#ifdef CHECK_FOR_HOLES
/*
* We intentionally do not rescan the areas copied by the GC.