Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8057586: Explicit GC ignored if GCLocker is active #13191

Closed
wants to merge 13 commits into from
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
@@ -2104,7 +2104,7 @@ bool G1CollectedHeap::try_collect_fullgc(GCCause::Cause cause,
VMThread::execute(&op);

// Request is trivially finished.
if (!GCCause::is_explicit_gc(cause) || op.gc_succeeded()) {
if (!GCCause::is_explicit_full_gc(cause) || op.gc_succeeded()) {
return op.gc_succeeded();
}

4 changes: 1 addition & 3 deletions src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
Original file line number Diff line number Diff line change
@@ -553,9 +553,7 @@ void ParallelScavengeHeap::collect(GCCause::Cause cause) {
VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
VMThread::execute(&op);

if (!GCCause::is_explicit_gc(cause) ||
!VM_ParallelGCSystemGC::is_cause_full(cause) ||
op.full_gc_succeeded()) {
if (!GCCause::is_explicit_full_gc(cause) || op.full_gc_succeeded()) {
return;
}

2 changes: 1 addition & 1 deletion src/hotspot/share/gc/parallel/psVMOperations.cpp
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ void VM_ParallelGCFailedAllocation::doit() {
}
}

bool VM_ParallelGCSystemGC::is_cause_full(GCCause::Cause cause) {
static bool is_cause_full(GCCause::Cause cause) {
return (cause != GCCause::_gc_locker) && (cause != GCCause::_wb_young_gc)
DEBUG_ONLY(&& (cause != GCCause::_scavenge_alot));
}
1 change: 0 additions & 1 deletion src/hotspot/share/gc/parallel/psVMOperations.hpp
Original file line number Diff line number Diff line change
@@ -46,7 +46,6 @@ class VM_ParallelGCSystemGC: public VM_GC_Operation {
virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; }
virtual void doit();
bool full_gc_succeeded() const { return _full_gc_succeeded; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we name this gc_succeeded like in g1?

static bool is_cause_full(GCCause::Cause cause);
};

#endif // SHARE_GC_PARALLEL_PSVMOPERATIONS_HPP
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/shared/gcCause.hpp
Original file line number Diff line number Diff line change
@@ -95,10 +95,9 @@ class GCCause : public AllStatic {
cause == GCCause::_dcmd_gc_run);
}

inline static bool is_explicit_gc(GCCause::Cause cause) {
inline static bool is_explicit_full_gc(GCCause::Cause cause) {
return (is_user_requested_gc(cause) ||
is_serviceability_requested_gc(cause) ||
cause == GCCause::_wb_young_gc ||
cause == GCCause::_wb_full_gc);
}

2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shared/genCollectedHeap.cpp
Original file line number Diff line number Diff line change
@@ -801,7 +801,7 @@ void GenCollectedHeap::collect(GCCause::Cause cause) {
cause, max_generation);
VMThread::execute(&op);

if (!GCCause::is_explicit_gc(cause) || should_run_young_gc) {
if (!GCCause::is_explicit_full_gc(cause)) {
return;
}