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

8264788: Make SequentialSubTasksDone use-once #3372

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Apr 7, 2021

Hi all,

can I have reviews for this change that simplifies code ahead?

SequentialSubTasksDone has some machinery to reset itself automatically after all tasks were claimed.

This is not used at all and can/should be removed.

Test: tier1-3


Progress

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

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3372/head:pull/3372
$ git checkout pull/3372

Update a local copy of the PR:
$ git checkout pull/3372
$ git pull https://git.openjdk.java.net/jdk pull/3372/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3372

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3372.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 7, 2021

👋 Welcome back tschatzl! 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 Apr 7, 2021
@openjdk
Copy link

openjdk bot commented Apr 7, 2021

@tschatzl 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 Apr 7, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 7, 2021

Webrevs

@tschatzl
Copy link
Contributor Author

tschatzl commented Apr 7, 2021

Note that it is possible to remove the CAS loop in SequentialSubTasksDone with an atomic add. I wasn't sure to do this, but if somebody thinks it is a good idea (and probably faster in many implementations) similar to the following:

bool SequentialSubTasksDone::try_claim_task(uint& t) {
  if (t < _num_tasks) {
    t = Atomic::add(&_num_claimed, 1) - 1;
  }
  return t < _num_tasks;
}

(And slightly fixing that assert in the destructor)

Copy link
Member

@albertnetymk albertnetymk left a comment

Choose a reason for hiding this comment

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

Looking at how SequentialSubTasksDone is used, I don't really see the benefit of having assert(_num_claimed == _num_tasks) in the destructor. If we drop that assertion, Atomic::add is more readable.

I prefer Atomic::add with the assertion removed, but this version is fine as well.

@tschatzl
Copy link
Contributor Author

tschatzl commented Apr 8, 2021

I changed to the Atomic::add but kept the assert (modified).

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.

Looks good.

@openjdk
Copy link

openjdk bot commented Apr 14, 2021

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

8264788: Make SequentialSubTasksDone use-once

Reviewed-by: ayang, sjohanss

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 105 new commits pushed to the master branch:

  • e2106d5: 8265104: CpuLoad and SystemCpuLoad in OperatingSystem MXBean returns -1.0
  • ebbce91: 8264681: Use the blessed modifier order in java.security
  • ea5c55a: 8265103: Remove unnecessary inclusion of oopMap.hpp
  • 26186ec: 8039261: [TEST_BUG]: There is not a minimal security level in Java Preferences and the TestApplet.html is blocked.
  • 283d64f: 8262896: [macos_aarch64] Crash in jni_fast_GetLongField
  • 55d5649: 8263157: [macos]: java.library.path is being set incorrectly
  • e80012e: 8264768: JFR: Allow events to be printed to the log
  • 3b576ed: 8265100: (fs) WindowsFileStore.hashCode() should read cached hash code once
  • 8df8512: 8265125: IGV: cannot edit forms with NetBeans GUI builder
  • 9cd5400: 8265138: Simplify DerUtils::checkAlg
  • ... and 95 more: https://git.openjdk.java.net/jdk/compare/a611c462f938176d8fad303ec7a53191ce85c5d1...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 14, 2021
@tschatzl
Copy link
Contributor Author

/integrate

@tschatzl
Copy link
Contributor Author

Thanks @albertnetymk @kstefanj for your reviews.

@openjdk openjdk bot closed this Apr 15, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 15, 2021
@openjdk
Copy link

openjdk bot commented Apr 15, 2021

@tschatzl Since your change was applied there have been 126 commits pushed to the master branch:

  • 0793fcb: 8260255: C1: LoopInvariantCodeMotion constructor can leave some fields uninitialized
  • b224b56: 8265225: jdk/jfr/tool/TestConfigure.java fails to cleanup the output files after the testing
  • 7c6e379: 8265120: hs_err improvement: align the output of Virtual space metadata
  • e7cbeba: 8259070: Add jcmd option to dump CDS
  • 5931948: 8265246: Fix macos-Aarch64 build after JDK-8263709
  • 79bff21: 8263709: Cleanup THREAD/TRAPS/CHECK usage in JRT_ENTRY routines
  • f4c3efd: 8265192: [macos_aarch64] configure script fails if GNU uname in PATH
  • e167577: 8265078: jpackage tests on Windows leave large temp files
  • 05f851e: 8265236: ProblemList java/foreign/TestUpcall.java on macosx-aarch64
  • d1b28e7: 8265231: (fc) ReadDirect and WriteDirect tests fail after fix for JDK-8264821
  • ... and 116 more: https://git.openjdk.java.net/jdk/compare/a611c462f938176d8fad303ec7a53191ce85c5d1...master

Your commit was automatically rebased without conflicts.

Pushed as commit 125a847.

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

@tschatzl tschatzl deleted the 8264788-sequentialsubtasksdone-use-once branch April 15, 2021 08:11
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