Skip to content

Commit

Permalink
bugfix: make sure symbol loading from Base.gc_page_utilization_data w…
Browse files Browse the repository at this point in the history
…orks on linux (#52406)

Co-authored-by: Jameson Nash <[email protected]>
  • Loading branch information
d-netto and vtjnash authored Dec 5, 2023
1 parent 4209474 commit 2949dd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ end
# must be kept in sync with the value from `src/julia_threads.h``
const JL_GC_N_MAX_POOLS = 51
function gc_page_utilization_data()
page_utilization_raw = cglobal(:gc_page_utilization_stats, Float64)
page_utilization_raw = cglobal(:jl_gc_page_utilization_stats, Float64)
return Base.unsafe_wrap(Array, page_utilization_raw, JL_GC_N_MAX_POOLS, own=false)
end

Expand Down
4 changes: 2 additions & 2 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ int jl_gc_classify_pools(size_t sz, int *osize)
// sweep phase

gc_fragmentation_stat_t gc_page_fragmentation_stats[JL_GC_N_POOLS];
JL_DLLEXPORT double gc_page_utilization_stats[JL_GC_N_MAX_POOLS];
JL_DLLEXPORT double jl_gc_page_utilization_stats[JL_GC_N_MAX_POOLS];

STATIC_INLINE void gc_update_page_fragmentation_data(jl_gc_pagemeta_t *pg) JL_NOTSAFEPOINT
{
Expand All @@ -1442,7 +1442,7 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
if (n_pages_allocd != 0) {
utilization -= ((double)n_freed_objs * (double)jl_gc_sizeclasses[i]) / (double)n_pages_allocd / (double)GC_PAGE_SZ;
}
gc_page_utilization_stats[i] = utilization;
jl_gc_page_utilization_stats[i] = utilization;
jl_atomic_store_relaxed(&stats->n_freed_objs, 0);
jl_atomic_store_relaxed(&stats->n_pages_allocd, 0);
}
Expand Down

0 comments on commit 2949dd5

Please sign in to comment.