diff options
author | Rickard Green <[email protected]> | 2017-03-01 17:05:53 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-04-11 17:53:46 +0200 |
commit | b5cd902c38687b9578d2222ace7956fdb26c9401 (patch) | |
tree | beab2f75b6799741d057a823b6eac46d1309f122 /erts/emulator/beam | |
parent | 53f11c147d7c7a1557e12a7c262c2289d89047aa (diff) | |
download | otp-b5cd902c38687b9578d2222ace7956fdb26c9401.tar.gz otp-b5cd902c38687b9578d2222ace7956fdb26c9401.tar.bz2 otp-b5cd902c38687b9578d2222ace7956fdb26c9401.zip |
Fix dirty GC implementation
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_gc.c | 14 |
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); |