aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-03-01 17:05:53 +0100
committerRickard Green <[email protected]>2017-04-11 17:53:46 +0200
commitb5cd902c38687b9578d2222ace7956fdb26c9401 (patch)
treebeab2f75b6799741d057a823b6eac46d1309f122 /erts/emulator
parent53f11c147d7c7a1557e12a7c262c2289d89047aa (diff)
downloadotp-b5cd902c38687b9578d2222ace7956fdb26c9401.tar.gz
otp-b5cd902c38687b9578d2222ace7956fdb26c9401.tar.bz2
otp-b5cd902c38687b9578d2222ace7956fdb26c9401.zip
Fix dirty GC implementation
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_gc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 50805d9cd9..d51d4fff45 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -479,9 +479,15 @@ delay_garbage_collection(Process *p, ErlHeapFragment *live_hf_end, int need, int
p->live_hf_end = live_hf_end;
}
- if (need == 0)
+ if (need == 0) {
+#ifdef ERTS_DIRTY_SCHEDULERS
+ if (p->flags & (F_DIRTY_MAJOR_GC|F_DIRTY_MINOR_GC)) {
+ ASSERT(!ERTS_SCHEDULER_IS_DIRTY(erts_proc_sched_data(p)));
+ goto force_reschedule;
+ }
+#endif
return 1;
-
+ }
/*
* Satisfy need in a heap fragment...
*/
@@ -534,6 +540,10 @@ delay_garbage_collection(Process *p, ErlHeapFragment *live_hf_end, int need, int
p->heap_hfrag = hfrag;
#endif
+#ifdef ERTS_DIRTY_SCHEDULERS
+force_reschedule:
+#endif
+
/* Make sure that we do a proper GC as soon as possible... */
p->flags |= F_FORCE_GC;
reds_left = ERTS_REDS_LEFT(p, fcalls);