aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Zhengyu Gu <zgu@openjdk.org> 2021-03-24 12:14:14 +0000
committerGravatar Zhengyu Gu <zgu@openjdk.org> 2021-03-24 12:14:14 +0000
commit9ee0b9a17bfa4fc2e4e5fa00cfd76aaa5dbbfd94 (patch)
tree7bcc5601f5bbd436dc57b2059baf36e96f950477
parente55aa41f57f6031954a5254143d7320aa864454a (diff)
downloadjdk-9ee0b9a17bfa4fc2e4e5fa00cfd76aaa5dbbfd94.tar.gz
jdk-9ee0b9a17bfa4fc2e4e5fa00cfd76aaa5dbbfd94.zip
8264052: Shenandoah: Backout 8263832
Reviewed-by: shade
-rw-r--r--src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
index acfef5e1756..38c4adfad7d 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp
@@ -96,19 +96,23 @@ class ShenandoahSATBAndRemarkThreadsClosure : public ThreadClosure {
private:
SATBMarkQueueSet& _satb_qset;
OopClosure* const _cl;
+ uintx _claim_token;
public:
ShenandoahSATBAndRemarkThreadsClosure(SATBMarkQueueSet& satb_qset, OopClosure* cl) :
_satb_qset(satb_qset),
- _cl(cl) {}
+ _cl(cl),
+ _claim_token(Threads::thread_claim_token()) {}
void do_thread(Thread* thread) {
- // Transfer any partial buffer to the qset for completed buffer processing.
- _satb_qset.flush_queue(ShenandoahThreadLocalData::satb_mark_queue(thread));
- if (thread->is_Java_thread()) {
- if (_cl != NULL) {
- ResourceMark rm;
- thread->oops_do(_cl, NULL);
+ if (thread->claim_threads_do(true, _claim_token)) {
+ // Transfer any partial buffer to the qset for completed buffer processing.
+ _satb_qset.flush_queue(ShenandoahThreadLocalData::satb_mark_queue(thread));
+ if (thread->is_Java_thread()) {
+ if (_cl != NULL) {
+ ResourceMark rm;
+ thread->oops_do(_cl, NULL);
+ }
}
}
}
@@ -143,7 +147,7 @@ public:
ShenandoahMarkRefsClosure mark_cl(q, rp);
ShenandoahSATBAndRemarkThreadsClosure tc(satb_mq_set,
ShenandoahIUBarrier ? &mark_cl : NULL);
- Threads::possibly_parallel_threads_do(true /*par*/, &tc);
+ Threads::threads_do(&tc);
}
_cm->mark_loop(worker_id, _terminator, rp,