Skip to content

Commit

Permalink
8321410: Shenandoah: Remove ShenandoahSuspendibleWorkers flag
Browse files Browse the repository at this point in the history
Backport-of: 2830dd2a7d3b933fbddca64ca0ac7a91e7ab0775
  • Loading branch information
shipilev committed Feb 6, 2024
1 parent 85f4f38 commit 447f58c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ShenandoahConcurrentMarkingTask : public WorkerTask {
void work(uint worker_id) {
ShenandoahHeap* heap = ShenandoahHeap::heap();
ShenandoahConcurrentWorkerSession worker_session(worker_id);
ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers);
ShenandoahSuspendibleThreadSetJoiner stsj;
ShenandoahReferenceProcessor* rp = heap->ref_processor();
assert(rp != nullptr, "need reference processor");
StringDedup::Requests requests;
Expand Down
12 changes: 4 additions & 8 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ class ShenandoahEvacuationTask : public WorkerTask {
void work(uint worker_id) {
if (_concurrent) {
ShenandoahConcurrentWorkerSession worker_session(worker_id);
ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers);
ShenandoahSuspendibleThreadSetJoiner stsj;
ShenandoahEvacOOMScope oom_evac_scope;
do_work();
} else {
Expand Down Expand Up @@ -1989,7 +1989,7 @@ class ShenandoahUpdateHeapRefsTask : public WorkerTask {
void work(uint worker_id) {
if (CONCURRENT) {
ShenandoahConcurrentWorkerSession worker_session(worker_id);
ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers);
ShenandoahSuspendibleThreadSetJoiner stsj;
do_work<ShenandoahConcUpdateRefsClosure>();
} else {
ShenandoahParallelWorkerSession worker_session(worker_id);
Expand Down Expand Up @@ -2171,15 +2171,11 @@ bool ShenandoahHeap::uncommit_bitmap_slice(ShenandoahHeapRegion *r) {
}

void ShenandoahHeap::safepoint_synchronize_begin() {
if (ShenandoahSuspendibleWorkers) {
SuspendibleThreadSet::synchronize();
}
SuspendibleThreadSet::synchronize();
}

void ShenandoahHeap::safepoint_synchronize_end() {
if (ShenandoahSuspendibleWorkers) {
SuspendibleThreadSet::desynchronize();
}
SuspendibleThreadSet::desynchronize();
}

void ShenandoahHeap::entry_uncommit(double shrink_before, size_t shrink_until) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ inline bool ShenandoahHeap::cancelled_gc() const {
}

inline bool ShenandoahHeap::check_cancelled_gc_and_yield(bool sts_active) {
if (sts_active && ShenandoahSuspendibleWorkers && !cancelled_gc()) {
if (sts_active && !cancelled_gc()) {
if (SuspendibleThreadSet::should_yield()) {
SuspendibleThreadSet::yield();
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void ShenandoahMark::mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint w
if (work == 0) {
// No work encountered in current stride, try to terminate.
// Need to leave the STS here otherwise it might block safepoints.
ShenandoahSuspendibleThreadSetLeaver stsl(CANCELLABLE && ShenandoahSuspendibleWorkers);
ShenandoahSuspendibleThreadSetLeaver stsl(CANCELLABLE);
ShenandoahTerminatorTerminator tt(heap);
if (terminator->offer_termination(&tt)) return;
}
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,6 @@
"How many times to maximum attempt to flush SATB buffers at the " \
"end of concurrent marking.") \
\
product(bool, ShenandoahSuspendibleWorkers, true, EXPERIMENTAL, \
"Suspend concurrent GC worker threads at safepoints") \
\
product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC, \
"Turn on/off SATB barriers in Shenandoah") \
\
Expand Down
26 changes: 0 additions & 26 deletions test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
* TestAllocObjects
*
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
* -XX:+ShenandoahSuspendibleWorkers
* TestAllocObjects
*
*/

/*
Expand All @@ -97,11 +91,6 @@
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
* TestAllocObjects
*
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
* -XX:+ShenandoahSuspendibleWorkers
* TestAllocObjects
*/

/*
Expand All @@ -112,11 +101,6 @@
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
* TestAllocObjects
*
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
* -XX:+ShenandoahSuspendibleWorkers
* TestAllocObjects
*/

/*
Expand All @@ -127,11 +111,6 @@
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
* TestAllocObjects
*
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
* -XX:+ShenandoahSuspendibleWorkers
* TestAllocObjects
*/

/*
Expand Down Expand Up @@ -177,11 +156,6 @@
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
* TestAllocObjects
*
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
* -XX:+ShenandoahSuspendibleWorkers
* TestAllocObjects
*/

public class TestAllocObjects {
Expand Down

1 comment on commit 447f58c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.