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

8263976: Remove block allocation from BasicHashtable #3123

Closed
wants to merge 2 commits into from

Conversation

coleenp
Copy link
Contributor

@coleenp coleenp commented Mar 22, 2021

From CR:
The useful/general BasicHashtable uses a block allocation scheme to reportedly reduce fragmentation. When the StringTable and SymbolTable used to use this hashtable, performance benefits were reportedly observed because of the block allocation scheme. Since these tables were moved to the concurrent hashtables, the tables left that use the block allocation scheme are:

AdapterHandlerLibrary, ResolutionError, LoaderConstraints, Leak profiler bitset table and Placeholders. 3 of these tables are very small and never needed block allocation to prevent fragmentation at least. Also there are 3 KVHashtables, which are built from BasicHashtable. 2 are used during dumping and 1 is ID2KlassTable which appears small.

ModuleEntry, PackageEntry, Dictionary, G1RootSet for nmethods, and JvmtiTagMap tables didn't use the block allocation scheme.

Removing this removes 7 pointers per table, and for each ClassLoaderData, which has 3 tables, removes 21 pointers.

This change was performance tested on linux and windows.

It was also tested with tier1-6.


Progress

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

Issue

  • JDK-8263976: Remove block allocation from BasicHashtable

Reviewers

Download

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

To update a local copy of the PR:
$ git checkout pull/3123
$ git pull https://git.openjdk.java.net/jdk pull/3123/head

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 22, 2021

👋 Welcome back coleenp! 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 Mar 22, 2021
@openjdk
Copy link

openjdk bot commented Mar 22, 2021

@coleenp The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Mar 22, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 22, 2021

Webrevs

@coleenp
Copy link
Contributor Author

coleenp commented Mar 22, 2021

I forgot to add that we can eventually replace these tables with std::unordered_set once the allocation and other template parameters are decided on. There are also other cleanups that we could do with this code, ie. Hashtable isn't that different from BasicHashtable so really isn't needed. We could make the Entry type a template parameter. This change is only a step in this direction.

Copy link
Member

@lfoltan lfoltan left a comment

Choose a reason for hiding this comment

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

Great clean up Coleen! ModuleEntryTable and PackageEntryTable changes looks good as does the other changes as well.
Lois

@openjdk
Copy link

openjdk bot commented Mar 22, 2021

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

8263976: Remove block allocation from BasicHashtable

Reviewed-by: lfoltan, iklam

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

  • f62b100: 8263895: Test nsk/jvmti/GetThreadGroupChildren/getthrdgrpchld001/getthrdgrpchld001.cpp uses incorrect indices
  • f84b52b: 8263897: compiler/c2/aarch64/TestVolatilesSerial.java failed with "java.lang.RuntimeException: Wrong method"
  • f08bf4b: 8263891: Changes for 8076985 missed the fix.
  • b2df513: 8261785: Calling "main" method in anonymous nested class crashes the JVM
  • 840ab7b: 8263894: Convert defaultPrinter and printers fields to local variables

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Mar 22, 2021
Copy link
Member

@iklam iklam 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 overall. Just some small nits.

src/hotspot/share/utilities/hashtable.cpp Outdated Show resolved Hide resolved
src/hotspot/share/utilities/hashtable.cpp Outdated Show resolved Hide resolved
@coleenp
Copy link
Contributor Author

coleenp commented Mar 23, 2021

Thanks Lois and Ioi!
/integrate

@openjdk openjdk bot closed this Mar 23, 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 Mar 23, 2021
@coleenp coleenp deleted the hashtable-block branch March 23, 2021 12:11
@openjdk
Copy link

openjdk bot commented Mar 23, 2021

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

  • fbd57bd: 8263260: [s390] Support latest hardware (z14 and z15)
  • de2ff25: 8263974: Move SystemDictionary::verify_protection_domain
  • 9dad857: 8263080: Obsolete relationship in MulticastSocket API documentation.
  • 851474a: 8263649: AArch64: update cas.m4 to match current AD file
  • fd3a33a: 8263189: C2: assert(!had_error) failed: bad dominance
  • 7b81f8e: 8263915: runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java fails when UseCompressedClassPointers is off
  • 2da882c: 8262465: Very long compilation times and high memory consumption in C2 debug builds
  • 0b03d04: 8167015: compiler/codecache/jmx/PoolsIndependenceTest.java timeout
  • df01b15: 8263977: GTK L&F: Cleanup duplicate checks in GTKStyle and GTKLookAndFeel
  • 57d8f1d: 8263985: BCEscapeAnalyzer::invoke checks target->is_loaded() twice
  • ... and 14 more: https://git.openjdk.java.net/jdk/compare/ba504fcee8ba9ca3e6c223effc46754444a9c49f...master

Your commit was automatically rebased without conflicts.

Pushed as commit 5bc382f.

💡 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 serviceability serviceability-dev@openjdk.org
3 participants