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
  • Loading branch information
pliden committed Oct 3, 2020
1 parent 22f0916 commit 1dd5cb7
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

0 comments on commit 1dd5cb7

Please sign in to comment.