Skip to content

Commit

Permalink
reset mark queue indices at the end of GC (JuliaLang#52780)
Browse files Browse the repository at this point in the history
Should allow us to access fewer pages on the circular buffers owned by
these work-stealing queues.
  • Loading branch information
d-netto committed Jul 3, 2024
1 parent 84dc564 commit 2ed98a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3166,6 +3166,17 @@ void gc_mark_clean_reclaim_sets(void)
free(a);
}
}
// Reset queue indices
for (int i = 0; i < gc_n_threads; i++) {
jl_ptls_t ptls2 = gc_all_tls_states[i];
if (ptls2 == NULL) {
continue;
}
jl_atomic_store_relaxed(&ptls2->mark_queue.ptr_queue.bottom, 0);
jl_atomic_store_relaxed(&ptls2->mark_queue.ptr_queue.top, 0);
jl_atomic_store_relaxed(&ptls2->mark_queue.chunk_queue.bottom, 0);
jl_atomic_store_relaxed(&ptls2->mark_queue.chunk_queue.top, 0);
}
}

static void gc_premark(jl_ptls_t ptls2)
Expand Down

0 comments on commit 2ed98a2

Please sign in to comment.