未验证 提交 f265abd8 编写于 作者: P Peter Sollich 提交者: GitHub

Move sync block scan (#41600)

This change implements some primitive work stealing by executing GCScan::GcWeakPtrScanBySingleThread on the first thread that finishes GCScan::GcWeakPtrScan and sort_mark_list.
上级 05cd29c8
...@@ -21819,11 +21819,13 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) ...@@ -21819,11 +21819,13 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p)
scan_dependent_handles(condemned_gen_number, &sc, false); scan_dependent_handles(condemned_gen_number, &sc, false);
#ifdef MULTIPLE_HEAPS #ifdef MULTIPLE_HEAPS
static VOLATILE(int32_t) syncblock_scan_p;
dprintf(3, ("Joining for weak pointer deletion")); dprintf(3, ("Joining for weak pointer deletion"));
gc_t_join.join(this, gc_join_null_dead_long_weak); gc_t_join.join(this, gc_join_null_dead_long_weak);
if (gc_t_join.joined()) if (gc_t_join.joined())
{ {
dprintf(3, ("Starting all gc thread for weak pointer deletion")); dprintf(3, ("Starting all gc thread for weak pointer deletion"));
syncblock_scan_p = 0;
gc_t_join.restart(); gc_t_join.restart();
} }
#endif //MULTIPLE_HEAPS #endif //MULTIPLE_HEAPS
...@@ -21838,17 +21840,21 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) ...@@ -21838,17 +21840,21 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p)
// unsigned long start = GetCycleCount32(); // unsigned long start = GetCycleCount32();
sort_mark_list(); sort_mark_list();
// printf("sort_mark_list took %u cycles\n", GetCycleCount32() - start); // printf("sort_mark_list took %u cycles\n", GetCycleCount32() - start);
// first thread to finish sorting will scan the sync syncblk cache
if ((syncblock_scan_p == 0) && (Interlocked::Increment(&syncblock_scan_p) == 1))
#endif //PARALLEL_MARK_LIST_SORT #endif //PARALLEL_MARK_LIST_SORT
#endif //MARK_LIST #endif //MARK_LIST
#endif //MULTIPLE_HEAPS
{
// scan for deleted entries in the syncblk cache
GCScan::GcWeakPtrScanBySingleThread(condemned_gen_number, max_generation, &sc);
}
#ifdef MULTIPLE_HEAPS
dprintf (3, ("Joining for sync block cache entry scanning")); dprintf (3, ("Joining for sync block cache entry scanning"));
gc_t_join.join(this, gc_join_null_dead_syncblk); gc_t_join.join(this, gc_join_null_dead_syncblk);
if (gc_t_join.joined()) if (gc_t_join.joined())
#endif //MULTIPLE_HEAPS #endif //MULTIPLE_HEAPS
{ {
// scan for deleted entries in the syncblk cache
GCScan::GcWeakPtrScanBySingleThread (condemned_gen_number, max_generation, &sc);
#ifdef MULTIPLE_HEAPS #ifdef MULTIPLE_HEAPS
#if defined(MARK_LIST) && !defined(PARALLEL_MARK_LIST_SORT) #if defined(MARK_LIST) && !defined(PARALLEL_MARK_LIST_SORT)
//compact g_mark_list and sort it. //compact g_mark_list and sort it.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册