Skip to content

Commit

Permalink
8253971: ZGC: Flush mark stacks after processing concurrent roots
Browse files Browse the repository at this point in the history
Reviewed-by: ayang, eosterlund
  • Loading branch information
pliden committed Oct 5, 2020
1 parent 19219a9 commit 65cab55
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hotspot/share/gc/z/zMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,15 @@ class ZMarkConcurrentRootsIteratorClosure : public ZRootsIteratorClosure {

class ZMarkConcurrentRootsTask : public ZTask {
private:
ZMark* const _mark;
SuspendibleThreadSetJoiner _sts_joiner;
ZConcurrentRootsIteratorClaimStrong _roots;
ZMarkConcurrentRootsIteratorClosure _cl;

public:
ZMarkConcurrentRootsTask(ZMark* mark) :
ZTask("ZMarkConcurrentRootsTask"),
_mark(mark),
_sts_joiner(),
_roots(),
_cl() {
Expand All @@ -662,6 +664,12 @@ class ZMarkConcurrentRootsTask : public ZTask {

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();
}
};

Expand Down

1 comment on commit 65cab55

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 65cab55 Oct 5, 2020

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.