From: Peter Sollich Date: Wed, 22 Sep 2021 06:22:18 +0000 (+0200) Subject: We should not call distribute_free_regions at the end of background GC - then it... X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~13017 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d80343c0f0d8c800045b55fe00b37cbe1279dcd;p=platform%2Fupstream%2Fdotnet%2Fruntime.git We should not call distribute_free_regions at the end of background GC - then it may run concurrently with user threads allocating and getting regions from the free lists. (#59413) --- diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index f018ec4..5fcc273 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -20703,14 +20703,14 @@ void gc_heap::gc1() #endif //FEATURE_LOH_COMPACTION decommit_ephemeral_segment_pages(); -#ifdef USE_REGIONS - distribute_free_regions(); -#endif //USE_REGIONS - fire_pevents(); if (!(settings.concurrent)) { +#ifdef USE_REGIONS + distribute_free_regions(); +#endif //USE_REGIONS + rearrange_uoh_segments(); update_end_ngc_time(); update_end_gc_time_per_heap();