Skip to content

Conversation

@dev-jonghoonpark
Copy link
Contributor

@dev-jonghoonpark dev-jonghoonpark commented Sep 14, 2025

related jira issue: https://bugs.openjdk.org/browse/JDK-8366716


Following the direction outlined in the issue description,
I've extracted the common parts from TestTracePageSizes and TestTransparentHugePagesHeap to implement the SmapsParser test library.

I've confirmed that it works without issues in my local tests.

Reviews and feedback are welcome.


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-8366716: Move SmapsParser from runtime/os/TestTracePageSizes.java into testlib (Enhancement - P4)

Reviewers

Contributors

  • Stefan Johansson <sjohanss@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27273

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 14, 2025

👋 Welcome back dev-jonghoonpark! 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 Sep 14, 2025

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

8366716: Move SmapsParser from runtime/os/TestTracePageSizes.java into testlib

Co-authored-by: Stefan Johansson <sjohanss@openjdk.org>
Reviewed-by: sjohanss, syan

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 449 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@sendaoYan, @kstefanj) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk
Copy link

openjdk bot commented Sep 14, 2025

@dev-jonghoonpark this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8366716-create-smapsparser-lib
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Sep 14, 2025
@openjdk
Copy link

openjdk bot commented Sep 14, 2025

@dev-jonghoonpark The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot

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 hotspot hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review labels Sep 14, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 14, 2025

Webrevs

@dev-jonghoonpark dev-jonghoonpark marked this pull request as draft September 14, 2025 08:44
@openjdk openjdk bot removed the rfr Pull request is ready for review label Sep 14, 2025
@dev-jonghoonpark
Copy link
Contributor Author

I converted this PR to a draft due to changes in #27143

@dev-jonghoonpark dev-jonghoonpark force-pushed the JDK-8366716-create-smapsparser-lib branch from bff215a to 538b440 Compare September 14, 2025 09:45
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Sep 14, 2025
@dev-jonghoonpark dev-jonghoonpark marked this pull request as ready for review September 14, 2025 09:57
@dev-jonghoonpark
Copy link
Contributor Author

dev-jonghoonpark commented Sep 14, 2025

I’ve finished merging the changes and switched the status back to 'ready for review.'

I have confirmed that both TestTracePageSizes and TestTransparentHugePagesHeap pass when tested locally.


Additionally, I verified that TestTransparentHugePagesHeap also passes without any issues when the -XX:+UseCompressedOops option is added, as shown below:

OutputAnalyzer oa = ProcessTools.executeTestJava("-XX:+Use" + args[0] + "GC", "-Xmx128m", "-Xms128m", "-Xlog:pagesize:thp-%p.log", "-XX:+UseTransparentHugePages", "-XX:+UseCompressedOops", VerifyTHPEnabledForHeap.class.getName());

Is this the correct way to verify it?

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 14, 2025
@dev-jonghoonpark dev-jonghoonpark changed the title 8364927: Move SmapsParser from runtime/os/TestTracePageSizes.java into testlib 8366716: Move SmapsParser from runtime/os/TestTracePageSizes.java into testlib Sep 14, 2025
@AlanBateman
Copy link
Contributor

/label remove core-libs

@openjdk openjdk bot removed the core-libs core-libs-dev@openjdk.org label Sep 15, 2025
@openjdk
Copy link

openjdk bot commented Sep 15, 2025

@AlanBateman
The core-libs label was successfully removed.

@stefank
Copy link
Member

stefank commented Sep 15, 2025

Is this the correct way to verify it?

I think @kstefanj , who wrote the RFE and probably intended to implement it, might have ideas on how to verify this.

@kstefanj
Copy link
Contributor

Is this the correct way to verify it?

The problem we had in testing (JDK-8366980) was that we saw failures when running with -XX:-UseCompressedOops so that should be explicitly verified (-XX:+UseCompressedOops is the default). Adding it to the process launcher in the code works for testing, but to test without altering the code you can also pass it in. If you run the tests through make:

make test TEST=gc/TestTransparentHugePagesHeap.java JTREG="JAVA_OPTIONS=-XX:-UseCompressedOops"

A couple of other comments without doing a proper review is that the new smaps classes should be located along side HugePageConfiguration under lib/os/linux and I think we want to think about how to structure the classes. Maybe something like this:

public class Smaps {
    public static class Parser { ... }
    public static class Range { ... }
}

@dev-jonghoonpark
Copy link
Contributor Author

@kstefanj

I've also tested it using the method that doesn't require altering the code, and it passed successfully.

Now, I'll move the path and refactor the code as you reviewed.

@dev-jonghoonpark dev-jonghoonpark force-pushed the JDK-8366716-create-smapsparser-lib branch from 538b440 to 873804c Compare September 15, 2025 12:47
@openjdk
Copy link

openjdk bot commented Sep 15, 2025

@dev-jonghoonpark Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@dev-jonghoonpark
Copy link
Contributor Author

I have finished refactoring and completed testing locally.

@kstefanj
Copy link
Contributor

Found some time to look closer at this. I would prefer if we could clean up the Smaps class even more when moving it to the testlib. We might want to go even further than this:
master...kstefanj:jdk:pull/27273-v2

I felt it was easier to show you my ideas this way rather than just giving comment. Some names might need improving and some more polishing, but what do you think about the general structure here?

Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
@dev-jonghoonpark dev-jonghoonpark force-pushed the JDK-8366716-create-smapsparser-lib branch from 873804c to 57b1dca Compare October 5, 2025 13:25
@openjdk
Copy link

openjdk bot commented Oct 5, 2025

@dev-jonghoonpark Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@dev-jonghoonpark
Copy link
Contributor Author

@kstefanj
Sorry for the late reply.

I’ve reviewed the code you wrote, and I think it’s much clearer!
I’ve updated it with your suggested changes and confirmed that everything works fine in testing.

//

Sorry for rebasing — it’s a habit of mine, and I did it without thinking. I’ll be more careful next time.

@kstefanj
Copy link
Contributor

kstefanj commented Oct 6, 2025

@dev-jonghoonpark, thanks for addressing my concerns.

I need to look over it again but I'm traveling this week and will have less time than normal for reviews. I'll see if I can find some time, otherwise I will look at this next week.

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.

Now I've had time to look through this and more or less nothing more to add, just a small update to one comment.

Did run some additional testing as well, which looked good.

Please also add me ass co-author since we now have collaborated on the change, just use the commands:

/contributor add @dev-jonghoonpark 
/contributor add @kstefanj

@openjdk
Copy link

openjdk bot commented Oct 13, 2025

@kstefanj Only the author (@dev-jonghoonpark) is allowed to issue the contributor command.

@openjdk
Copy link

openjdk bot commented Oct 13, 2025

@kstefanj Only the author (@dev-jonghoonpark) is allowed to issue the contributor command.

@dev-jonghoonpark
Copy link
Contributor Author

dev-jonghoonpark commented Oct 13, 2025

/contributor add @dev-jonghoonpark
/contributor add @kstefanj

@openjdk
Copy link

openjdk bot commented Oct 13, 2025

@dev-jonghoonpark @dev-jonghoonpark was not found in the census.

Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address.

@openjdk
Copy link

openjdk bot commented Oct 13, 2025

@dev-jonghoonpark
Contributor Stefan Johansson <sjohanss@openjdk.org> successfully added.

Co-authored-by: Stefan Johansson <54407259+kstefanj@users.noreply.github.com>
@openjdk openjdk bot removed the rfr Pull request is ready for review label Oct 13, 2025
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 13, 2025
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 14, 2025
@dev-jonghoonpark
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 14, 2025
@openjdk
Copy link

openjdk bot commented Oct 14, 2025

@dev-jonghoonpark
Your change (at version e82154f) is now ready to be sponsored by a Committer.

@kstefanj
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 14, 2025

Going to push as commit 90cf3a2.
Since your change was applied there have been 449 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 Oct 14, 2025
@openjdk openjdk bot closed this Oct 14, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Oct 14, 2025
@openjdk
Copy link

openjdk bot commented Oct 14, 2025

@kstefanj @dev-jonghoonpark Pushed as commit 90cf3a2.

💡 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

Development

Successfully merging this pull request may close these issues.

5 participants