Skip to content

Conversation

@jdksjolen
Copy link
Contributor

@jdksjolen jdksjolen commented Feb 6, 2025

Hi,

Please consider this trivial patch. Note that this gives us consistency with reserve_memory.

  static inline void record_virtual_memory_reserve(void* addr, size_t size, /* ... */);

Thanks.


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-8349580: Do not use address in MemTracker top level functions (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23497

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 6, 2025

👋 Welcome back jsjolen! 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 Feb 6, 2025

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

8349580: Do not use address in MemTracker top level functions

Reviewed-by: gziemski, stefank

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

  • 7cd5cb2: 8349532: Refactor ./util/Pem/encoding.sh to run in java
  • 86cec4e: 8343782: G1: Use one G1CardSet instance for multiple old gen regions
  • 006ed5c: 8349375: Cleanup AIX special file build settings
  • 3989a19: 8344925: translet-name ignored when package-name is also set
  • 1eb54e4: 8346049: jdk/test/lib/security/timestamp/TsaServer.java warnings
  • a0c7f66: 8349508: runtime/cds/appcds/TestParallelGCWithCDS.java should not check for specific output
  • 1079147: 8348570: CTW: Expose the code hidden by uncommon traps
  • 1a74ee6: 8349092: File.getFreeSpace violates specification if quotas are in effect (win)
  • 0181030: 8349006: File.getCanonicalPath should remove "(on UNIX platforms)" from its specification
  • ed8945a: 8347377: Add validation checks for ICC_Profile header fields
  • ... and 42 more: https://git.openjdk.org/jdk/compare/81126c20cbcab577d82e690d9cf1c1b738754a07...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 changed the title 8349580 8349580: Do not use address in MemTracker top level functions Feb 6, 2025
@openjdk
Copy link

openjdk bot commented Feb 6, 2025

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Feb 6, 2025
@jdksjolen jdksjolen marked this pull request as ready for review February 6, 2025 21:20
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 6, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 6, 2025

Webrevs

assert_post_init();
if (!enabled()) return;
if (addr != nullptr) {
VirtualMemoryTracker::remove_released_region((address)addr, size);

Choose a reason for hiding this comment

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

What about 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.

Hi,

That's correct as VMT does take address, whilst the external API takes "regular" pointers.

Choose a reason for hiding this comment

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

Hmm, looks weird. Are we planning on cleaning this up further up the chain then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is not the plan, no. I believe that the address typedef is there to signify that we are concerned with storing addresses, but not dereferencing them.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 7, 2025
Copy link

@gerard-ziemski gerard-ziemski left a comment

Choose a reason for hiding this comment

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

LGTM

@jdksjolen
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 10, 2025

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

  • c9cadbd: 8346567: Make Class.getModifiers() non-native
  • 5589892: 8343074: test/jdk/com/sun/net/httpserver/docs/test1/largefile.txt could be generated
  • d104deb: 8349556: RISC-V: improve the performance when -COH and -AvoidUnalignedAccesses for UL and LU string comparison
  • 4a83ca1: 8349666: RISC-V: enable superwords tests for vector reductions
  • 8f6ccde: 8349554: [UBSAN] os::attempt_reserve_memory_between reported applying non-zero offset to non-null pointer produced null pointer
  • 7d52f1e: 8349525: RBTree: provide leftmost, rightmost, and a simple way to print trees
  • e9278de: 8348411: C2: Remove the control input of LoadKlassNode and LoadNKlassNode
  • 5395ffa: 8327378: XMLStreamReader throws EOFException instead of XMLStreamException
  • 1ed9ef1: 8349559: Compiler interface doesn't need to store protection domain
  • f0ea38b: 8349509: [macos] Clean up macOS dead code in jpackage
  • ... and 57 more: https://git.openjdk.org/jdk/compare/81126c20cbcab577d82e690d9cf1c1b738754a07...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 10, 2025

@jdksjolen Pushed as commit f74c4df.

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

@tstuefe
Copy link
Member

tstuefe commented Feb 10, 2025

We use address in most other parts of the JVM for "unspecified pointer". I would rather use address more consistently (also for APIs that today take "char*" for historical reasons).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants