Skip to content

Commit 65cab55

Browse files
committedOct 5, 2020
8253971: ZGC: Flush mark stacks after processing concurrent roots
Reviewed-by: ayang, eosterlund
1 parent 19219a9 commit 65cab55

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/hotspot/share/gc/z/zMark.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,15 @@ class ZMarkConcurrentRootsIteratorClosure : public ZRootsIteratorClosure {
643643

644644
class ZMarkConcurrentRootsTask : public ZTask {
645645
private:
646+
ZMark* const _mark;
646647
SuspendibleThreadSetJoiner _sts_joiner;
647648
ZConcurrentRootsIteratorClaimStrong _roots;
648649
ZMarkConcurrentRootsIteratorClosure _cl;
649650

650651
public:
651652
ZMarkConcurrentRootsTask(ZMark* mark) :
652653
ZTask("ZMarkConcurrentRootsTask"),
654+
_mark(mark),
653655
_sts_joiner(),
654656
_roots(),
655657
_cl() {
@@ -662,6 +664,12 @@ class ZMarkConcurrentRootsTask : public ZTask {
662664

663665
virtual void work() {
664666
_roots.oops_do(&_cl);
667+
668+
// Flush and free worker stacks. Needed here since
669+
// the set of workers executing during root scanning
670+
// can be different from the set of workers executing
671+
// during mark.
672+
_mark->flush_and_free();
665673
}
666674
};
667675

0 commit comments

Comments
 (0)
Please sign in to comment.