Skip to content

Commit

Permalink
CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Maoni0 committed Sep 16, 2024
1 parent e1615ef commit d8aa9f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,10 @@ class t_join
return join_struct.n_threads;
}

// This is for instrumentation only.
int get_join_lock()
{
return join_struct.join_lock;
return VolatileLoadWithoutBarrier (&join_struct.join_lock);
}

void destroy ()
Expand Down Expand Up @@ -2425,7 +2426,7 @@ last_recorded_gc_info gc_heap::last_full_blocking_gc_info;

uint64_t gc_heap::last_alloc_reset_suspended_end_time = 0;
size_t gc_heap::max_peak_heap_size = 0;
size_t gc_heap::llc_size = 0;
VOLATILE(size_t) gc_heap::llc_size = 0;

#ifdef BACKGROUND_GC
last_recorded_gc_info gc_heap::last_bgc_info[2];
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -5193,8 +5193,6 @@ class gc_heap
PER_HEAP_ISOLATED_FIELD_MAINTAINED size_t current_total_soh_stable_size;
PER_HEAP_ISOLATED_FIELD_MAINTAINED uint64_t last_suspended_end_time;
PER_HEAP_ISOLATED_FIELD_MAINTAINED uint64_t change_heap_count_time;
PER_HEAP_ISOLATED_FIELD_MAINTAINED uint64_t total_change_heap_count;
PER_HEAP_ISOLATED_FIELD_MAINTAINED uint64_t total_change_heap_count_time;

// If the last full GC is blocking, this is that GC's index; for BGC, this is the settings.gc_index
// when the BGC ended.
Expand Down Expand Up @@ -5408,8 +5406,8 @@ class gc_heap
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY size_t max_peak_heap_size;

// Sometimes it's difficult to figure out why we get the gen0 min/max budget.
// These fields help figure those out.
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY size_t llc_size;
// These fields help figure those out. Making it volatile so it doesn't get optimized out.
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY VOLATILE(size_t) llc_size;

#ifdef BACKGROUND_GC
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY gc_history_global bgc_data_global;
Expand Down Expand Up @@ -5442,6 +5440,8 @@ class gc_heap
#ifdef DYNAMIC_HEAP_COUNT
// Number of times we bailed from check_heap_count because we didn't have enough memory for the preparation
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY size_t hc_change_cancelled_count_prep;
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY uint64_t total_change_heap_count;
PER_HEAP_ISOLATED_FIELD_DIAG_ONLY uint64_t total_change_heap_count_time;

#ifdef BACKGROUND_GC
// We log an entry whenever we needed to create new BGC threads.
Expand Down

0 comments on commit d8aa9f8

Please sign in to comment.