8253971: ZGC: Flush mark stacks after processing concurrent roots

Reviewed-by: ayang, eosterlund
This commit is contained in:
Per Liden 2020-10-05 13:18:38 +00:00
parent 19219a964b
commit 65cab55c1b

@ -643,6 +643,7 @@ public:
class ZMarkConcurrentRootsTask : public ZTask {
private:
ZMark* const _mark;
SuspendibleThreadSetJoiner _sts_joiner;
ZConcurrentRootsIteratorClaimStrong _roots;
ZMarkConcurrentRootsIteratorClosure _cl;
@ -650,6 +651,7 @@ private:
public:
ZMarkConcurrentRootsTask(ZMark* mark) :
ZTask("ZMarkConcurrentRootsTask"),
_mark(mark),
_sts_joiner(),
_roots(),
_cl() {
@ -662,6 +664,12 @@ public:
virtual void work() {
_roots.oops_do(&_cl);
// Flush and free worker stacks. Needed here since
// the set of workers executing during root scanning
// can be different from the set of workers executing
// during mark.
_mark->flush_and_free();
}
};