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

8248149: G1: change _cleaning_claimed from int to bool #14487

Closed

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Jun 15, 2023

Hi all,

please review this change to fix some claim variable from int to bool as it should be.

Testing: gha

Thanks,
Thomas


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-8248149: G1: change _cleaning_claimed from int to bool (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14487

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 15, 2023

👋 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 changed the title 8248149 8248149: G1: change _cleaning_claimed from int to bool Jun 15, 2023
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 15, 2023
@openjdk
Copy link

openjdk bot commented Jun 15, 2023

@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 Jun 15, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 15, 2023

Webrevs

Copy link
Contributor

@lkorinth lkorinth 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 to me, thanks for cleaning it up.

@openjdk
Copy link

openjdk bot commented Jun 15, 2023

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

8248149: G1: change _cleaning_claimed from int to bool

Reviewed-by: lkorinth, ayang, kbarrett

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

  • 9f64a64: 8301379: Verify TLS_ECDH_* cipher suites cannot be negotiated
  • 4a5475c: 8309953: Strengthen and optimize oopDesc age methods
  • 79ff72a: 8308499: Test vmTestbase/nsk/jdi/MethodExitRequest/addClassExclusionFilter/filter001/TestDescription.java failed: VMDisconnectedException
  • 3e0bbd2: 8285368: Overhaul doc-comment inheritance
  • 3eeb681: 8167252: Some of Charset.availableCharsets() does not contain itself
  • 653a8d0: 8310129: SetupNativeCompilation LIBS should match the order of the other parameters
  • 947f149: 8308444: LoadStoreNode::result_not_used() is too conservative
  • 8b4af46: 8309974: some JVMCI tests fail when VM options include -XX:+EnableJVMCI
  • 0038491: 8309978: [x64] Fix useless padding
  • 5f3613e: 8309960: ParallelGC young collections very slow in DelayInducer
  • ... and 2 more: https://git.openjdk.org/jdk/compare/4c0e164238458e0e95770a855ba84bb265ff0397...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 Jun 15, 2023
return false;
}

return Atomic::cmpxchg(&_cleaning_claimed, 0, 1) == 0;
return !Atomic::cmpxchg(&_cleaning_claimed, false, true);

Choose a reason for hiding this comment

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

It might be an int because making it a bool may involve a byte-sized cmpxchg, which has a not very
nice implementation on some platforms. Though even with that the claim cost is likely dwarfed by
other costs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to believe that when this has been implemented, there has been no cmpxchg overload for bools before the atomics refactoring. We did not go back and look for these kind of mismatches.

There should be no visible performance difference, so I prefer using the more appropriate type.

Choose a reason for hiding this comment

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

Yeah, that's probably correct. We used to have a cmpxchg overload for jbyte, but never explicitly bool.

return false;
}

return Atomic::cmpxchg(&_cleaning_claimed, 0, 1) == 0;
return !Atomic::cmpxchg(&_cleaning_claimed, false, true);

Choose a reason for hiding this comment

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

Yeah, that's probably correct. We used to have a cmpxchg overload for jbyte, but never explicitly bool.

@tschatzl
Copy link
Contributor Author

Thanks @albertnetymk @kimbarrett @lkorinth for your reviews

/integrate

@openjdk
Copy link

openjdk bot commented Jun 16, 2023

Going to push as commit fb024fd.
Since your change was applied there have been 24 commits pushed to the master branch:

  • c2b043e: 8310183: Update GitHub Actions to use boot JDK for building jtreg
  • 238c51e: 8293069: Make -XX:+Verbose less verbose
  • 8c9b85a: 8303916: ThreadLists.java inconsistent results
  • 227656f: 8309408: Thread.sleep cleanup
  • 32243ef: 8310128: Switch with unnamed patterns erroneously non-exhaustive
  • cfae6ef: 8309778: java/nio/file/Files/CopyAndMove.java fails when using second test directory
  • db133db: 8310106: sun.security.ssl.SSLHandshake.getHandshakeProducer() incorrectly checks handshakeConsumers
  • 353e581: 8309747: Update --release 21 symbol information for JDK 21 build 27
  • d3d0dbc: 8309756: Occasional crashes with pipewire screen capture on Wayland
  • 9216750: 8308643: Incorrect value of 'used' jvmstat counter
  • ... and 14 more: https://git.openjdk.org/jdk/compare/4c0e164238458e0e95770a855ba84bb265ff0397...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 16, 2023
@openjdk openjdk bot closed this Jun 16, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 16, 2023
@openjdk
Copy link

openjdk bot commented Jun 16, 2023

@tschatzl Pushed as commit fb024fd.

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

@tschatzl tschatzl deleted the submit/8248149-change-cleaning-bool branch June 23, 2023 12:20
@su1table
Copy link

su1table commented Jul 20, 2023 via email

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
5 participants