Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ void ShenandoahGenerationalControlThread::check_for_request(ShenandoahGCRequest&
// failure (degenerated cycle), or old marking was cancelled to run a young collection.
// In either case, the correct generation for the next cycle can be determined by
// the cancellation cause.
request.cause = _heap->cancelled_cause();
request.cause = _heap->clear_cancellation(GCCause::_shenandoah_concurrent_gc);
if (request.cause == GCCause::_shenandoah_concurrent_gc) {
request.generation = _heap->young_generation();
_heap->clear_cancelled_gc(false);
}
} else {
request.cause = _requested_gc_cause;
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ class ShenandoahHeap : public CollectedHeap {
// old mark does _not_ touch the oom handler).
inline void clear_cancelled_gc(bool clear_oom_handler = true);

// Clears the cancellation cause iff the current cancellation reason equals the given
// expected cancellation cause. Does not reset the oom handler.
inline GCCause::Cause clear_cancellation(GCCause::Cause expected);

void cancel_concurrent_mark();

// Returns true if and only if this call caused a gc to be cancelled.
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include "classfile/javaClasses.inline.hpp"
#include "gc/shared/continuationGCSupport.inline.hpp"
#include "gc/shared/gcCause.hpp"
#include "gc/shared/markBitMap.inline.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/shared/threadLocalAllocBuffer.inline.hpp"
Expand Down Expand Up @@ -280,6 +281,10 @@ inline void ShenandoahHeap::clear_cancelled_gc(bool clear_oom_handler) {
}
}

inline GCCause::Cause ShenandoahHeap::clear_cancellation(GCCause::Cause expected) {
return _cancelled_gc.cmpxchg(GCCause::_no_gc, expected);
}

inline HeapWord* ShenandoahHeap::allocate_from_gclab(Thread* thread, size_t size) {
assert(UseTLAB, "TLABs should be enabled");

Expand Down