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

8323681: SA PointerFinder code should support G1 #17691

Closed
wants to merge 5 commits into from

Conversation

plummercj
Copy link
Contributor

@plummercj plummercj commented Feb 2, 2024

This PR adds G1 support to PointerFinder/PointerLocation. Previously we only had SerialGC support. Previously for G1 addresses SA would only report that the address is "In unknown section of Java heap" with no other details. Now it provides details for G1 addresses. Here are some examples for clhsdb threadcontext output. threadcontext dumps the contents of the thread's registers, some of which are often in the java heap. In the output below the first line is without verbose output and the 2nd is with:

rbp: 0x00000000a0004080: In G1 heap region
rbp: 0x00000000a0004080: In G1 heap Region: 0x00000000a0000000,0x00000000a0018a30,0x00000000a1000000:Old

I also added an improvement to how SA deals with addresses in the TLAB. It used to only report that the address is in a TLAB and provide details about the TLAB in verbose mode. Now if verbose mode is used, the heap region information is included after the TLAB information. Here again is an example without and with verbose output:

rsi: 0x0000000166000000: In TLAB for thread "main" sun.jvm.hotspot.runtime.JavaThread@0x00007f11c8029250
rsi: 0x0000000166000000: In TLAB for thread ("main" #1 prio=5 tid=0x00007f11c8029250 nid=1503 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   JavaThread state: _thread_in_java
)  [0x0000000166000000,0x00000001662d0c90,0x00000001667ffdc0,{0x0000000166800000})
In G1 heap Region: 0x0000000166000000,0x0000000166800000,0x0000000167000000:Eden

Note at the end it indicates the address is in the Eden space, which is probably always the case for G1 TLAB addresses. For SerialGC is shows something similar.

rsi: 0x0000000088ff99e0: In TLAB for thread "main" sun.jvm.hotspot.runtime.JavaThread@0x00007f0544029110
rsi: 0x0000000088ff99e0: In TLAB for thread ("main" #1 prio=5 tid=0x00007f0544029110 nid=3098 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   JavaThread state: _thread_in_java
)  [0x0000000088ff99e0,0x000000008978c090,0x0000000089ae54b0,{0x0000000089ae56f0})
In heap new generation:  eden [0x0000000080200000,0x0000000089ae56f0,0x00000000a2420000) space capacity = 572653568, 27.99656213789626 used
  from [0x00000000a6860000,0x00000000a6860030,0x00000000aaca0000) space capacity = 71565312, 6.707160027472528E-5 used
  to   [0x00000000a2420000,0x00000000a2420000,0x00000000a6860000) space capacity = 71565312, 0.0 used

Testing all svc test in tier1, tier2, and tier5. Currently in progress.


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-8323681: SA PointerFinder code should support G1 (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17691

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 2, 2024

👋 Welcome back cjplummer! 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 8323681 8323681: SA PointerFinder code should support G1 Feb 2, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 2, 2024
@openjdk
Copy link

openjdk bot commented Feb 2, 2024

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

  • hotspot-gc
  • 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-gc hotspot-gc-dev@openjdk.org labels Feb 2, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 2, 2024

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

Seems good.

@openjdk
Copy link

openjdk bot commented Feb 6, 2024

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

8323681: SA PointerFinder code should support G1

Reviewed-by: tschatzl, kevinw

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

  • 96eb039: 8324665: Loose matching of space separators in the lenient date/time parsing mode
  • 2d252ee: 8325180: Rename jvmti_FollowRefObjects.h
  • b814c31: 8321703: jdeps generates illegal dot file containing nodesep=0,500000
  • 50b17d9: 8316704: Regex-free parsing of Formatter and FormatProcessor specifiers
  • 51d7169: 8320237: C2: late inlining of method handle invoke causes duplicate lines in PrintInlining output
  • fd89b33: 8316992: Potential null pointer from get_current_thread JVMCI helper function.
  • d1c8215: 8325194: GHA: Add macOS M1 testing
  • f356970: 8322535: Change default AArch64 SpinPause instruction
  • b75c134: 8325313: Header format error in TestIntrinsicBailOut after JDK-8317299
  • 4cd3187: 8324874: AArch64: crypto pmull based CRC32/CRC32C intrinsics clobber V8-V15 registers
  • ... and 30 more: https://git.openjdk.org/jdk/compare/a18b03b86fdd0eef773badbced46607a8e5a068a...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 Feb 6, 2024
Copy link
Contributor

@kevinjwalls kevinjwalls 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.

Trivia on the output formatting:
For serial, an object not in a tlab, without verbose, I think it prints "In heap new generation:" and then nothing else.
The ":" leaves you hanging thinking it should introduce something else, so there must have been a problem showing the something else. 8-)

Maybe we should just remove the 3 colons from the serial gen printing, then we have that it looked like before?
(or hold on until we are in "if (verbose)" if we want to add them)

@plummercj
Copy link
Contributor Author

Trivia on the output formatting: For serial, an object not in a tlab, without verbose, I think it prints "In heap new generation:" and then nothing else. The ":" leaves you hanging thinking it should introduce something else, so there must have been a problem showing the something else. 8-)

Maybe we should just remove the 3 colons from the serial gen printing, then we have that it looked like before? (or hold on until we are in "if (verbose)" if we want to add them)

Ok, I've made that change. You now only get the colon during verbose output. Note that gen.priontOn() prints a leading space, so no need to put a space explicitly after the colon.

@plummercj
Copy link
Contributor Author

Thanks for the reviews Thomas and Kevin!

/integrate

@openjdk
Copy link

openjdk bot commented Feb 7, 2024

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

  • fbd15b2: 8325189: Enable this-escape javac warning in java.base
  • 299a8ee: 8325302: Files.move(REPLACE_EXISTING) throws NoSuchFileException on deleted target
  • 3a1f4d0: 8325268: Add policy statement to langtools makefiles concerning warnings
  • 18e24d0: 8325109: Sort method modifiers in canonical order
  • a3a2b1f: 8324881: ObjectSynchronizer::inflate(Thread* current...) is invoked for non-current thread
  • a9c6e87: 8325416: Parallel: Refactor CheckForUnmarkedOops
  • 1ecf74c: 8325306: Rename static huge pages to explicit huge pages
  • c3a632d: 8325248: Serial: Remove Generation::space_iterate
  • 77ee7f0: 8325221: Obsolete TLABStats
  • 4abb10e: 8317349: Randomize order of macro node expansion in C2
  • ... and 46 more: https://git.openjdk.org/jdk/compare/a18b03b86fdd0eef773badbced46607a8e5a068a...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 7, 2024

@plummercj Pushed as commit be7cc1c.

💡 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-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants