Skip to content
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

8257676: Simplify WeakProcessorPhase #1620

Closed
wants to merge 2 commits into from

Conversation

@kimbarrett
Copy link

@kimbarrett kimbarrett commented Dec 4, 2020

Please review this reimplementation of WeakProcessorPhase. It is changed to
a scoped enum at namespace scope, and uses the recently added EnumIterator
facility to provide iteration, rather than a bespoke iterator class.

This is a step toward eliminating it entirely. I've split it out into a
separate PR to make the review of the follow-up work a bit easier.

As part of this the file weakProcessorPhases.hpp is renamed to
weakProcessorPhase.hpp, but git doesn't seem to be recognizing that as a
rename and (majorly) edit, instead treating it as a remove and add a new
file.

Testing: mach5 tier1


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1620/head:pull/1620
$ git checkout pull/1620

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 4, 2020

👋 Welcome back kbarrett! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@kimbarrett
Copy link
Author

@kimbarrett kimbarrett commented Dec 4, 2020

/label hotspot-gc

@openjdk
Copy link

@openjdk openjdk bot commented Dec 4, 2020

@kimbarrett The following label will be automatically applied to this pull request:

  • hotspot

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.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 4, 2020

@kimbarrett
The hotspot-gc label was successfully added.

@kimbarrett
Copy link
Author

@kimbarrett kimbarrett commented Dec 4, 2020

/label remove hotspot

@openjdk openjdk bot removed the hotspot label Dec 4, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 4, 2020

@kimbarrett
The hotspot label was successfully removed.

@kimbarrett kimbarrett marked this pull request as ready for review Dec 4, 2020
@openjdk openjdk bot added the rfr label Dec 4, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 4, 2020

Webrevs

Copy link
Member

@walulyai walulyai left a comment

lgtm

CountingClosure<IsAlive, KeepAlive> cl(is_alive, keep_alive);
WeakProcessorPhaseTimeTracker pt(_phase_times, phase, worker_id);
StorageState* cur_state = _storage_states.par_state(phase);
int state_index = checked_cast<int>(phase_range.index(phase));
Copy link
Member

@albertnetymk albertnetymk Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel EnumRange<WeakProcessorPhase>().index(phase) is better than phase_range.index(phase), since we want to know the "global" index for this phase, not the "local" index within this particular range instance. The two are identical currently. However, if the for-loop is iterating over a subset of all WeakProcessorPhase, the two cases will give different results, I believe.

Copy link
Author

@kimbarrett kimbarrett Dec 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this isn't entirely ideal as-is. If someone were to change
phase_range to be a subset of the full range, then this line would need to
be examined and probably modified. However, that's not going to happen. This
PR is an intermediate step toward eliminating WeakProcessorPhase entirely,
which will address this issue (among others). I have that followup ready for
review once this one is integrated and I've rebased and retested.

Copy link
Member

@albertnetymk albertnetymk Dec 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see; thanks for the explanation.

@openjdk
Copy link

@openjdk openjdk bot commented Dec 10, 2020

@kimbarrett 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:

8257676: Simplify WeakProcessorPhase

Reviewed-by: iwalulya, ayang, tschatzl

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Dec 10, 2020
@kimbarrett
Copy link
Author

@kimbarrett kimbarrett commented Dec 11, 2020

Thanks @walulyai , @albertnetymk , @tschatzl for reviews.

@kimbarrett
Copy link
Author

@kimbarrett kimbarrett commented Dec 11, 2020

/integrate

@openjdk openjdk bot closed this Dec 11, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 11, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 11, 2020

@kimbarrett Pushed as commit fa20186.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@kimbarrett kimbarrett deleted the simplify_weak_phase branch Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants