-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8242847: G1 should not clear mark bitmaps with no marks #5213
Conversation
👋 Welcome back iwalulya! A progress list of the required criteria for merging this PR into |
Webrevs
|
@@ -640,20 +670,21 @@ class G1ClearBitMapTask : public AbstractGangTask { | |||
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&_cl, &_hr_claimer, worker_id); | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary newline.
} | ||
return r->end(); | ||
} | ||
|
||
public: | ||
G1ClearBitmapHRClosure(G1CMBitMap* bitmap, G1ConcurrentMark* cm) : HeapRegionClosure(), _bitmap(bitmap), _cm(cm) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this code is so highly specific to clearing _next_bitmap
(and depending on current state which TAMS is the correct one for a given region) I would prefer if the code did not have configurable bitmap
too.
assert(_bitmap->get_next_marked_addr(r->next_top_at_mark_start(), r->end()) == r->end(), "Should not have marked bits above ntams"); | ||
return r->next_top_at_mark_start(); | ||
} | ||
return r->end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not in the UndoMark
operation (and doing the work concurrently), we could use the prev_top_at_mark_start()
here, couldn't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, did you measure what gain (in saved bitmap distance) does using the TAMSes give here? Asking because most TAMSes should be either at the end (=almost the same as top) or bottom of the region, only the current old gen allocation region at the time of the concurrent mark start pause may have a different one (I think).
Maybe that additional suggested (by me) optimization is not worth the effort...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, only in a few cases is TAMS below end, and even then, it is way smaller than chunk_size_in_words.
@@ -586,24 +586,49 @@ class G1ClearBitMapTask : public AbstractGangTask { | |||
private: | |||
G1CMBitMap* _bitmap; | |||
G1ConcurrentMark* _cm; | |||
|
|||
bool has_aborted() { | |||
if (_cm != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put the predicate _cm != nullptr
in an extra method, something like is_clear_concurrent()
(or a better name) would improve readability...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
@walulyai This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 49 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Thanks for the reviews. /integrate |
Going to push as commit e36cbd8.
Your commit was automatically rebased without conflicts. |
Hi all,
Please review this change to bound the range of bitmap clearing for each region using the liveness data collected during marking. For the Concurrent Undo Mark cycle, the liveness information (next_top_at_mark_start and live_words) is in sync wrt. the _next_mark_bitmap that needs clearing. Hence, we use these details to clear only bitmaps for regions that were dirtied and need clearing i.e. only clear between [bottom, ntams), and only clear bitmaps for regions that had at least one bit set (i.e. have some live data).
Testing: Tier 1-3.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5213/head:pull/5213
$ git checkout pull/5213
Update a local copy of the PR:
$ git checkout pull/5213
$ git pull https://git.openjdk.java.net/jdk pull/5213/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5213
View PR using the GUI difftool:
$ git pr show -t 5213
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5213.diff