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

8296231: Fix MEMFLAGS for CHeapBitMaps #10948

Closed

Conversation

stefank
Copy link
Member

@stefank stefank commented Nov 2, 2022

Some usages of CHeapBitMaps rely on the default value of the MEMFLAGS argument (mtInternal). This is undesirable, and should be fixed.

I'd prefer to remove the default value, but there is currently a PR touching the BitMap classes, so I'd like to limit this Bug to only fixing the incorrect usage of mtInternal.


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

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10948

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

Using diff file

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

@stefank
Copy link
Member Author

stefank commented Nov 2, 2022

/label add hotspot

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 2, 2022

👋 Welcome back stefank! 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 hotspot hotspot-dev@openjdk.org label Nov 2, 2022
@openjdk
Copy link

openjdk bot commented Nov 2, 2022

@stefank
The hotspot label was successfully added.

@stefank stefank changed the title Fix CHeapBitMap MEMFLAGS 8296231: Fix CHeapBitMap MEMFLAGS Nov 2, 2022
@stefank stefank changed the title 8296231: Fix CHeapBitMap MEMFLAGS 8296231: Fix MEMFLAGS for CHeapBitMaps Nov 2, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 2, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 2, 2022

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

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

Looks reasonable.

@tstuefe
Copy link
Member

tstuefe commented Nov 2, 2022

I'd prefer to remove the default value, but there is currently a PR touching the BitMap classes, so I'd like to limit this Bug to only fixing the incorrect usage of mtInternal.

I always wanted something like a thread-bound default Memflags, that could be set with something like MemFlagsMark. It would define the Memflags to be used for the extent if no explicit Memflags are given. This would make sense, especially for utility classes that are used on behalf of other code. For example, wherever we dive into Metaspace allocation, we set the default flag to mtMetaspace, which is probably a good default for all subsequent mallocs in this extent.

What do you think?

@stefank
Copy link
Member Author

stefank commented Nov 3, 2022

I'd prefer to remove the default value, but there is currently a PR touching the BitMap classes, so I'd like to limit this Bug to only fixing the incorrect usage of mtInternal.

I always wanted something like a thread-bound default Memflags, that could be set with something like MemFlagsMark. It would define the Memflags to be used for the extent if no explicit Memflags are given. This would make sense, especially for utility classes that are used on behalf of other code. For example, wherever we dive into Metaspace allocation, we set the default flag to mtMetaspace, which is probably a good default for all subsequent mallocs in this extent.

What do you think?

I think it is unclear if this would be a net benefit for the code base. IMHO, it's easier to mess up by forgetting to add a MemFlagsMark, than if the compiler straight up told you that you need to provide a MEMFLAGS. It's also harder to look at a CHeap allocating call-site and figure out where the MemFlagsMark is located.

I'm interested in hearing what others think.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

This looks reasonable. I vote no on a MemFlagsMark - we have too many Mark things that are hard to explain where to put them.

@openjdk
Copy link

openjdk bot commented Nov 3, 2022

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

8296231: Fix MEMFLAGS for CHeapBitMaps

Reviewed-by: coleenp, dholmes

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

  • 4d1bc1b: 8296285: test/hotspot/jtreg/compiler/intrinsics/TestFloatIsFinite.java fails after JDK-8280378
  • 0349803: 8295319: pending_cards_at_gc_start doesn't include cards in thread buffers
  • 8f6c048: 8296337: CDS SharedArchiveConsistency tests fail after JDK-8296157
  • a8070fb: 8296157: Rename FileMapInfo::space_at() to region_at()
  • f43bb9f: 8296190: TestMD5Intrinsics and TestMD5MultiBlockIntrinsics don't test the intrinsics
  • b685fc2: 8295685: Update Libpng to 1.6.38
  • 94eb25a: 8256072: Eliminate JVMTI tagmap rehashing
  • 4338f52: 8294241: Deprecate URL public constructors
  • 68209ad: 8288232: Address typos in jar man page
  • 2ff9d3a: 8294858: XMLStreamReader does not respect jdk.xml.maxXMLNameLimit=0 for namespace names
  • ... and 21 more: https://git.openjdk.org/jdk/compare/6626a29a74ab0d10e4b036bced32fea1c6aab9e9...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 Nov 3, 2022
@tstuefe
Copy link
Member

tstuefe commented Nov 3, 2022

I think it is unclear if this would be a net benefit for the code base. IMHO, it's easier to mess up by forgetting to add a MemFlagsMark, than if the compiler straight up told you that you need to provide a MEMFLAGS. It's also harder to look at a CHeap allocating call-site and figure out where the MemFlagsMark is located.

This looks reasonable. I vote no on a MemFlagsMark - we have too many Mark things that are hard to explain where to put them.

No problem. It's good we talked about it before I sunk work into this.

Cheers, Thomas

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me too. Thanks.

I also "vote" against the MemFlagsMark - it would be too easy to include unintended allocations (that currently rely on default) and too hard to recognise you are within the scope of such a mark.

@stefank
Copy link
Member Author

stefank commented Nov 4, 2022

Thanks for the reviews and the discussion around future alternatives around CHeap allocations. I'm pushing this fix as is and I expect that we'll continue talking allocation strategies in other threads/PRs.

/integrate

@openjdk
Copy link

openjdk bot commented Nov 4, 2022

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

  • bd729e6: 8296380: IGV: Shortcut for quick search not working
  • c116ae7: 8295967: RISC-V: Support negVI/negVL instructions for Vector API
  • 9d3b4ef: 8296108: (tz) Update Timezone Data to 2022f
  • 4d1bc1b: 8296285: test/hotspot/jtreg/compiler/intrinsics/TestFloatIsFinite.java fails after JDK-8280378
  • 0349803: 8295319: pending_cards_at_gc_start doesn't include cards in thread buffers
  • 8f6c048: 8296337: CDS SharedArchiveConsistency tests fail after JDK-8296157
  • a8070fb: 8296157: Rename FileMapInfo::space_at() to region_at()
  • f43bb9f: 8296190: TestMD5Intrinsics and TestMD5MultiBlockIntrinsics don't test the intrinsics
  • b685fc2: 8295685: Update Libpng to 1.6.38
  • 94eb25a: 8256072: Eliminate JVMTI tagmap rehashing
  • ... and 24 more: https://git.openjdk.org/jdk/compare/6626a29a74ab0d10e4b036bced32fea1c6aab9e9...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 4, 2022

@stefank Pushed as commit 8ee0f7d.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants