Skip to content

8382089: G1: Refactor concurrent refinement state machine#30706

Open
albertnetymk wants to merge 2 commits intoopenjdk:masterfrom
albertnetymk:g1-refine
Open

8382089: G1: Refactor concurrent refinement state machine#30706
albertnetymk wants to merge 2 commits intoopenjdk:masterfrom
albertnetymk:g1-refine

Conversation

@albertnetymk
Copy link
Copy Markdown
Member

@albertnetymk albertnetymk commented Apr 13, 2026

Streamline the content of `G1ConcurrentRefineThread::do_refinement so each step/state is clearly visible, which is a good entry point for reviewing this refactoring. The largest diff is for step5/6, which is extracted into helpers just like the previous steps.

For state management, added enter_state(State, Ticks) that atomically updates state and records timestamp.

Test: tier1-7



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8382089: G1: Refactor concurrent refinement state machine (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30706/head:pull/30706
$ git checkout pull/30706

Update a local copy of the PR:
$ git checkout pull/30706
$ git pull https://git.openjdk.org/jdk.git pull/30706/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30706

View PR using the GUI difftool:
$ git pr show -t 30706

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30706.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 13, 2026

👋 Welcome back ayang! 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.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 13, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8382089 8382089: G1: Refactor concurrent refinement state machine Apr 13, 2026
@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Apr 13, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 13, 2026

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

  • hotspot-gc

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 openjdk bot added the rfr Pull request is ready for review label Apr 13, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 13, 2026

Webrevs

// 5. Sweep refinement table until done
bool interrupted_by_gc = false;

log_info(gc, task)("Concurrent Refine Sweep Using %u of %u Workers", _cr->num_threads_wanted(), _cr->max_num_threads());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this GC log, which displays the number of worker threads, is meaningful. Should it really be deleted?

break;
} else {
jlong yield_during_sweep_duration = os::elapsed_counter() - yield_during_sweep_start;
log_debug(gc, refine)("Yielded from card table sweeping for %.2fms, no GC inbetween, continue",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I haven’t looked at this log, so I can’t say whether it’s necessary or not, but is deleting it appropriate?

@albertnetymk
Copy link
Copy Markdown
Member Author

Restored both logs. I think "log_debug(gc, refine)("Yielded from card table sweeping ..." is not very useful, but can discuss/address that in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-gc hotspot-gc-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants