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

8257149: Improve G1 Service thread task scheduling to guarantee task delay #1451

Closed
wants to merge 3 commits into from

Conversation

albertnetymk
Copy link
Member

@albertnetymk albertnetymk commented Nov 26, 2020

Adopt the "at-least" semantics for scheduling delays in G1 service thread scheduling API so that a task is never scheduled earlier than it asked for. IOW, schedule_task(task, delay_ms) means task will run after >= delay_ms has passed.

Inspecting the logs (-Xlog:gc,gc+task*=trace) and focusing lines containing (Remembered Set Sampling Task) (schedule), we can see at what time the sampling task is scheduled.

Without ceil, sampling task could be scheduled more frequent than intended:

[0.321s][trace][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (schedule) @0.322s
[0.321s][debug][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (run) 0.042ms (cpu: 0.000ms)
[0.321s][debug][gc,task,start] G1 Service Thread (Remembered Set Sampling Task) (run)
[0.321s][trace][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (schedule) @0.322s
[0.321s][debug][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (run) 0.010ms (cpu: 0.000ms)
[0.321s][debug][gc,task,start] G1 Service Thread (Remembered Set Sampling Task) (run)
[0.321s][trace][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (schedule) @0.322s
[0.321s][debug][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (run) 0.008ms (cpu: 0.000ms)
[0.321s][debug][gc,task,start] G1 Service Thread (Remembered Set Sampling Task) (run)

With ceil; there's 300ms (G1ConcRefinementServiceIntervalMillis) interval btw each scheduling of the sampling task.

[0.093s][trace][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (schedule) @0.323s
[0.093s][debug][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (run) 0.006ms (cpu: 0.000ms)
[0.093s][debug][gc,task,start] G1 Service Thread (Periodic GC Task) (run)
[0.093s][trace][gc,task      ] G1 Service Thread (Periodic GC Task) (schedule) @1.093s
[0.093s][debug][gc,task      ] G1 Service Thread (Periodic GC Task) (run) 0.004ms (cpu: 0.000ms)
[0.093s][trace][gc,task      ] G1 Service Thread (wait) 0.230s
[0.323s][debug][gc,task,start] G1 Service Thread (Remembered Set Sampling Task) (run)
[0.323s][trace][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (schedule) @0.623s
[0.323s][debug][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (run) 0.024ms (cpu: 0.000ms)
[0.323s][trace][gc,task      ] G1 Service Thread (wait) 0.300s
[0.623s][debug][gc,task,start] G1 Service Thread (Remembered Set Sampling Task) (run)
[0.623s][trace][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (schedule) @0.923s
[0.623s][debug][gc,task      ] G1 Service Thread (Remembered Set Sampling Task) (run) 0.026ms (cpu: 0.000ms)
[0.623s][trace][gc,task      ] G1 Service Thread (wait) 0.300s

Tested: tier1 and manually checking the logs.


Progress

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

Testing

Linux x64 Linux x86 Windows x64 macOS x64
Build ❌ (1/2 failed) ✔️ (2/2 passed) ❌ (1/2 failed) ✔️ (2/2 passed)
Test (tier1) ⏳ (3/9 running) ⏳ (1/9 running)

Failed test tasks

Issue

  • JDK-8257149: Improve G1 Service thread task scheduling to guarantee task delay

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 26, 2020

👋 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 openjdk bot added the rfr Pull request is ready for review label Nov 26, 2020
@openjdk
Copy link

openjdk bot commented Nov 26, 2020

@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 hotspot-gc hotspot-gc-dev@openjdk.org label Nov 26, 2020
@mlbridge
Copy link

mlbridge bot commented Nov 26, 2020

Webrevs

Copy link
Contributor

@kstefanj kstefanj left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this Albert, just a few small comments. If you don't agree just leave them as is.

src/hotspot/share/gc/g1/g1RemSet.cpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/g1/g1ServiceThread.hpp Outdated Show resolved Hide resolved
src/hotspot/share/gc/g1/g1ServiceThread.hpp Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented Nov 26, 2020

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

8257149: Improve G1 Service thread task scheduling to guarantee task delay

Reviewed-by: sjohanss, iwalulya

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.

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 (@kstefanj, @walulyai) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 26, 2020
@albertnetymk
Copy link
Member Author

All suggestions are applied; thanks for the review.

@albertnetymk
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 27, 2020
@openjdk
Copy link

openjdk bot commented Nov 27, 2020

@albertnetymk
Your change (at version 8de51d2) is now ready to be sponsored by a Committer.

@kstefanj
Copy link
Contributor

/sponsor

@openjdk openjdk bot closed this Nov 27, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 27, 2020
@openjdk
Copy link

openjdk bot commented Nov 27, 2020

@kstefanj @albertnetymk Pushed as commit 20525d2.

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

@albertnetymk albertnetymk deleted the ceil-timeout branch November 27, 2020 11:58
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 integrated Pull request has been integrated
3 participants