8387751: G1: Remove volatile from G1CollectorState::_initiate_conc_mark_if_possible

Reviewed-by: aboldtch, ayang
This commit is contained in:
Thomas Schatzl 2026-07-07 12:54:01 +00:00
parent c8d4c7d181
commit fc73ca7f38
5 changed files with 6 additions and 6 deletions

View File

@ -59,7 +59,7 @@ class G1CollectorState {
// has been in progress when the request came in.
//
// This flag remembers that there is an unfullfilled request.
volatile bool _initiate_conc_mark_if_possible;
bool _initiate_conc_mark_if_possible;
public:
G1CollectorState() :

View File

@ -42,7 +42,7 @@ inline void G1CollectorState::set_in_full_gc() {
inline void G1CollectorState::set_in_concurrent_start_gc() {
_phase = Phase::YoungConcurrentStart;
_initiate_conc_mark_if_possible = false;
set_initiate_conc_mark_if_possible(false);
}
inline void G1CollectorState::set_in_prepare_mixed_gc() {
_phase = Phase::YoungPrepareMixed;

View File

@ -1253,6 +1253,7 @@ void G1Policy::update_survivors_policy() {
}
bool G1Policy::force_concurrent_start_if_outside_cycle(GCCause::Cause gc_cause) {
assert_at_safepoint_on_vm_thread();
// Check whether a concurrent cycle is active, do not include the
// reclamation/mixed phase. This means that we can schedule a concurrent cycle
// even while in the mixed phase.

View File

@ -335,9 +335,8 @@ private:
public:
// This sets the initiate_conc_mark_if_possible() flag to start a
// new cycle, as long as we are not already in one. It's best if it
// is called during a safepoint when the test whether a cycle is in
// progress or not is stable.
// new cycle, as long as we are not already in one. It is called
// at a safepoint.
bool force_concurrent_start_if_outside_cycle(GCCause::Cause gc_cause);
// Decide whether this garbage collection pause should be a concurrent start

View File

@ -144,7 +144,7 @@ public:
size_t allocation_word_size);
void collect();
G1CollectorState next_state() const { return _next_state; }
const G1CollectorState next_state() const { return _next_state; }
bool concurrent_operation_is_full_mark() const { return _concurrent_operation_is_full_mark; }
};