-
Notifications
You must be signed in to change notification settings - Fork 6k
8277372: Add getters for BOT and card table members #6570
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
Conversation
👋 Welcome back vish-chan! A progress list of the required criteria for merging this PR into |
@vish-chan The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@tstuefe : can you check whether the s390 and ppc changes still compile? The changes look straightforward enough, but... Thanks, |
@tschatzl We have s390 + ppcle builds now in GHAs thanks to Alexey, and they do look fine (https://github.com/openjdk/jdk/pull/6570/checks?check_run_id=4341321057). Seeing how simple the platform changes are, I think this is okay. Cheers, Thomas |
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.
I will push it through our testing, particular the changes for the SA agent (in vmstructs_gc.hpp
) are always good to double-check.
private: | ||
static uint _LogN; | ||
static uint _LogN_words; | ||
static uint _N_bytes; | ||
static uint _N_words; |
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.
The private
visibility modifier can be removed as this is default at the top of a class.
The static variables should start with a lower case letter after the underscore, something like _log_n
.
My suggestion would also be to change N
/n
to something more understandable, like size
, and add block
, i.e. something like _log_block_size
, _log_block_size_in_words
similar to the corresponding CardTable
members etc.
Edit: note that "block" isn't a good word to use here, so scratch that - "block" is any kind of area that is more generic than an object, but does not refer to the BOT entry.
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.
As I can understand, we need to replace "N" with something meaningful. Does something like "entry_size" or "bot_entry_size" would work?
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.
I would think that bot_entry_size
is one byte. Probably "bot_card_size"?
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.
Getting good :) Some minor comments.
@@ -287,12 +287,12 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, HeapWord* b | |||
for (size_t j = orig_index + 1; j <= end_index; j++) { | |||
assert(_bot->offset_array(j) > 0 && | |||
_bot->offset_array(j) <= | |||
(u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), | |||
(u_char) (BOTConstants::bot_card_size_words()+BOTConstants::N_powers-1), |
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.
(u_char) (BOTConstants::bot_card_size_words()+BOTConstants::N_powers-1), | |
(u_char) (BOTConstants::bot_card_size_words() + BOTConstants::N_powers - 1), |
Pre-existing: operator has no spaces around it
"offset array should have been set - " | ||
"%u not > 0 OR %u not <= %u", | ||
(uint) _bot->offset_array(j), | ||
(uint) _bot->offset_array(j), | ||
(uint) (BOTConstants::N_words+BOTConstants::N_powers-1)); | ||
(uint) (BOTConstants::bot_card_size_words()+BOTConstants::N_powers-1)); |
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.
(uint) (BOTConstants::bot_card_size_words()+BOTConstants::N_powers-1)); | |
(uint) (BOTConstants::bot_card_size_words() + BOTConstants::N_powers - 1)); |
Pre-existing: spaces around operator
@@ -413,7 +413,7 @@ void CardTable::dirty_card_iterate(MemRegion mr, MemRegionClosure* cl) { | |||
next_entry <= limit && *next_entry == dirty_card; | |||
dirty_cards++, next_entry++); | |||
MemRegion cur_cards(addr_for(cur_entry), | |||
dirty_cards*card_size_in_words); | |||
dirty_cards*_card_size_in_words); |
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.
dirty_cards*_card_size_in_words); | |
dirty_cards * _card_size_in_words); |
Pre-existing: spaces around operator
@@ -439,7 +439,7 @@ MemRegion CardTable::dirty_card_range_after_reset(MemRegion mr, | |||
next_entry <= limit && *next_entry == dirty_card; | |||
dirty_cards++, next_entry++); | |||
MemRegion cur_cards(addr_for(cur_entry), | |||
dirty_cards*card_size_in_words); | |||
dirty_cards*_card_size_in_words); |
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.
dirty_cards*_card_size_in_words); | |
dirty_cards * _card_size_in_words); |
Pre-existing: spaces around operator
static uint _block_shift; | ||
static uint _block_size; | ||
static uint _block_size_in_words; | ||
|
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.
Almost the same naming issue as in the BlockOffsetTable/SharedArray
; I would prefer if these members (and getters) here were named similarly to the ones there.
It is true that ObjectStartArray
and BlockOffsetTable
are basically the same thing, but any eventual merge is another issue.
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.
Shall these be renamed to osa_card_shift? Something like this?
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.
Okay, _osa_card_shift
and so on is also acceptable to me, but just _card_shift
/_card_size
would be fine too. We typically do not prefix members with abbreviations of class name they are in; I see now that we have that _bot
prefix in the other class, for me the bot
prefix not necessarily refers to the class but to the concept of a block offset table.
Maybe just reduce the names in both cases to _card_size
/_card_shift
/_log_card_<something>
? What do others think?
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 mean for both blockOffsetTable and objectStartArray, all the relevant members be renamed to _card_size and so on?
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.
I think this sounds like a good plan.
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.
Nice to see this unified. Some comments below.
static uint _log_bot_card_size; | ||
static uint _log_bot_card_size_words; | ||
static uint _bot_card_size_bytes; | ||
static uint _bot_card_size_words; |
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 change words
to in_words
to better match other places where we have sizes in words. And as Thomas suggested above, maybe also drop the bot
in/pre-fix.
And also change the getters below.
static uint _block_shift; | ||
static uint _block_size; | ||
static uint _block_size_in_words; | ||
|
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.
I think this sounds like a good plan.
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.
Just a very minor comment.
} | ||
|
||
void ObjectStartArray::initialize(MemRegion reserved_region) { | ||
// We're based on the assumption that we use the same | ||
// size blocks as the card table. | ||
assert((int)block_size == (int)CardTable::card_size, "Sanity"); | ||
assert(block_size <= MaxBlockSize, "block_size must be less than or equal to " UINT32_FORMAT, MaxBlockSize); | ||
assert((int)_card_size == (int)(CardTable::card_size()), "Sanity"); |
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.
I think the int
cast can be dropped; both sides are uint
.
@vish-chan 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 18 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@tschatzl, @kstefanj, @albertnetymk) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
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.
/integrate |
@vish-chan |
@tschatzl is there anything else required from my end? |
/sponsor |
Going to push as commit adf3952.
Your commit was automatically rebased without conflicts. |
@tschatzl @vish-chan Pushed as commit adf3952. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Changed the visibility, added getters and refactored the following:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6570/head:pull/6570
$ git checkout pull/6570
Update a local copy of the PR:
$ git checkout pull/6570
$ git pull https://git.openjdk.java.net/jdk pull/6570/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6570
View PR using the GUI difftool:
$ git pr show -t 6570
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6570.diff