Skip to content

Commit

Permalink
only enable concurrent sweeping on 64bit
Browse files Browse the repository at this point in the history
  • Loading branch information
d-netto authored and vchuravy committed Jun 25, 2023
1 parent 75ea307 commit f29fd67
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,13 +1440,18 @@ static jl_taggedvalue_t **gc_sweep_page(jl_gc_pool_t *p, jl_gc_pagemeta_t **allo
push_page_metadata_back(lazily_freed, pg);
}
else {
#ifdef _P64 // only enable concurrent sweeping on 64bit
if (jl_n_gcthreads == 0) {
jl_gc_free_page(pg);
push_lf_page_metadata_back(&global_page_pool_freed, pg);
}
else {
push_lf_page_metadata_back(&global_page_pool_lazily_freed, pg);
}
#else
jl_gc_free_page(pg);
push_lf_page_metadata_back(&global_page_pool_freed, pg);
#endif
}
gc_time_count_page(freedall, pg_skpd);
gc_num.freed += (nfree - old_nfree) * osize;
Expand Down Expand Up @@ -1566,6 +1571,7 @@ static void gc_sweep_pool(int sweep_full)
}
}

#ifdef _P64 // only enable concurrent sweeping on 64bit
// wake thread up to sweep concurrently
if (jl_n_gcthreads > 0) {
jl_atomic_fetch_add(&gc_sweeping_assists_needed, 1);
Expand All @@ -1574,6 +1580,7 @@ static void gc_sweep_pool(int sweep_full)
uv_cond_signal(&ptls2->wake_signal);
uv_mutex_unlock(&ptls2->sleep_lock);
}
#endif

gc_time_pool_end(sweep_full);
}
Expand Down

0 comments on commit f29fd67

Please sign in to comment.