Skip to content

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented Apr 2, 2025

This is mostly test change. ResolvedMethodTableHash.java is run /manual but still takes a long time and doesn't really verify that the hash code is any good. This add logging, triggers concurrent work like other ConcurrentHashtables, and checks that a small table is not rehashed.
Tested with tier1 (including test).


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-8349007: The jtreg test ResolvedMethodTableHash takes excessive time (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24383

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 2, 2025

👋 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
Copy link

openjdk bot commented Apr 2, 2025

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

8349007: The jtreg test ResolvedMethodTableHash takes excessive time

Reviewed-by: lmesnik, matsaave

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 142 new commits pushed to 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 rfr Pull request is ready for review label Apr 2, 2025
@openjdk
Copy link

openjdk bot commented Apr 2, 2025

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

  • hotspot

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 hotspot-dev@openjdk.org label Apr 2, 2025
@mlbridge
Copy link

mlbridge bot commented Apr 2, 2025

Webrevs

@coleenp coleenp changed the title 8349007: jtreg test ResolvedMethodTableHash takes excessive time 8349007: The jtreg test ResolvedMethodTableHash takes excessive time Apr 3, 2025
Copy link
Member

@lmesnik lmesnik left a comment

Choose a reason for hiding this comment

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

Seems that test is become much shorter, doesn't it the case of rehashing lost?
Might be better to have 2 tests:

  1. check that 1000 iterations don't cause rehashing
  2. original, stress scenario

How much time the take now?

Also, does it make sense to run test in several threads ? No need to now, just file RFE.

See more comments iline.

}
public static class ResolvedMethodTableHashTest extends ClassLoader {
// Generate a MethodHandle for ClassName.m()
private MethodHandle generate(String className) throws ReflectiveOperationException {
Copy link
Member

Choose a reason for hiding this comment

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

The indentation is wrong in line 53, 60, 70, 71, 96, 102, might be other places also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My indent script was a bit too agressive.

ResolvedMethodTableHashTest generator = new ResolvedMethodTableHashTest();
List<MethodHandle> handles = new ArrayList<>();

int count = args.length > 0 ? Integer.parseInt(args[0]) : 200000;
Copy link
Member

Choose a reason for hiding this comment

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

no need to check args and have default 20000, it is not executed, actually.
might be just hardcode 1000 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 fixed this to hardcode 1001 (want 1001 iterations to print the message).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a good suggestion, thank you.

@coleenp
Copy link
Contributor Author

coleenp commented Apr 3, 2025

This test was never meant to be a stress test, it was just checking that the hashcode didn't result in collisions for methods with the same name and signature.
With my change it takes 32 seconds to run make test TEST=runtime/MemberName/ResolvedMethodTableHash.java which is probably about 31 seconds for jtreg to run.

@lmesnik
Copy link
Member

lmesnik commented Apr 3, 2025

This test was never meant to be a stress test, it was just checking that the hashcode didn't result in collisions for methods with the same name and signature.
Thanks for explanation.
With my change it takes 32 seconds to run make test TEST=runtime/MemberName/ResolvedMethodTableHash.java which is probably about 31 seconds for jtreg to run.
That's fast enough to remove manual tag. I think it is up t o you if you want to run it in tier1 or move into tier2/3.

Copy link
Member

@lmesnik lmesnik 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 addressing the comments.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 4, 2025
Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

The change looks good!
Edit: I had the same question as Leonid and didn't notice that you had already answered it. Thanks!

@coleenp
Copy link
Contributor Author

coleenp commented Apr 9, 2025

Thank you for the code reviews Leonid and Matias.
/integrate

@openjdk
Copy link

openjdk bot commented Apr 9, 2025

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 9, 2025

@coleenp Pushed as commit 6352ee1.

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

@coleenp coleenp deleted the rmt-hash branch April 9, 2025 17:51
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

Development

Successfully merging this pull request may close these issues.

3 participants