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

8266217: ZGC: Improve the -Xlog:gc+init output for NUMA #3778

Closed
wants to merge 1 commit into from

Conversation

@DamonFool
Copy link
Member

@DamonFool DamonFool commented Apr 28, 2021

Hi all,

This patch improves the -Xlog:gc+init output for NUMA, which is suggested by StefanK [1].
The implementation just follows how UseLargePages are setup and printed.

Before (in docker, not support get_mempolicy)

[0.007s][info][gc,init] Initializing The Z Garbage Collector
[0.007s][info][gc,init] Version: 17-internal+0-adhoc..jdk (fastdebug)
[0.007s][info][gc,init] NUMA Support: Disabled
...

After (in docker, not support get_mempolicy)

[0.007s][info][gc,init] Initializing The Z Garbage Collector
[0.007s][info][gc,init] Version: 17-internal+0-adhoc..jdk (fastdebug)
[0.007s][info][gc,init] NUMA Support: Unsupported
...

Testing:

  • tier1~3 on Linux/x64, no regression

Thanks.
Best regards,
Jie

[1] https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2020-March/028927.html


Progress

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

Issue

  • JDK-8266217: ZGC: Improve the -Xlog:gc+init output for NUMA

Reviewers

Reviewing

Using git

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

Update a local copy of the PR:
$ git checkout pull/3778
$ git pull https://git.openjdk.java.net/jdk pull/3778/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3778

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3778.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 28, 2021

👋 Welcome back jiefu! 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.

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Apr 28, 2021

/test
/label add hotspot-gc
/cc hotspot-gc

Loading

@openjdk openjdk bot added the hotspot-gc label Apr 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 28, 2021

@DamonFool
The hotspot-gc label was successfully added.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 28, 2021

@DamonFool The hotspot-gc label was already applied.

Loading

@DamonFool DamonFool marked this pull request as ready for review Apr 29, 2021
@openjdk openjdk bot added the rfr label Apr 29, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 29, 2021

Webrevs

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Apr 29, 2021

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

8266217: ZGC: Improve the -Xlog:gc+init output for NUMA

Reviewed-by: stefank, tschatzl, pliden

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

  • 155da25: 8265005: Introduce the new client property for mac: apple.awt.windowTitleVisible
  • 91226fa: 8265940: Enable C2's optimization for Math.pow(x, 0.5) on all platforms
  • 56cde70: 8266265: mark hotspot compiler/vectorization tests which ignore VM flags
  • 4937214: 8266174: -Wmisleading-indentation happens in libmlib_image sources
  • b305eff: 8266238: mark hotspot compiler/inlining tests which ignore VM flags
  • df3b2d0: 8266264: mark hotspot compiler/eliminateAutobox tests which ignore VM flags
  • 6b263e6: 8266256: compiler.vectorization.TestBufferVectorization does testing twice
  • 69155f4: 8266231: mark hotspot compiler/c1 tests which ignore VM flags
  • 0e225ef: 8197821: Test java/awt/font/TextLayout/LigatureCaretTest.java fails on Windows
  • a1c942c: 8266170: -Wnonnull happens in classLoaderData.inline.hpp
  • ... and 3 more: https://git.openjdk.java.net/jdk/compare/794cefe8f92ab0c9d5c7c5265232518e8ffb166a...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.

Loading

@openjdk openjdk bot added the ready label Apr 29, 2021
@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Apr 29, 2021

Thanks @stefank for your review and help.

Loading

log_info_p(gc, init)("NUMA Nodes: %u", count());
}
}

const char* ZNUMA::to_string() {
return _enabled ? "Enabled" : "Disabled";
switch (_state) {
Copy link
Contributor

@tschatzl tschatzl Apr 29, 2021

Choose a reason for hiding this comment

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

Maybe consider to have a static const char* strings[] = {"Enabled", "Unsupported", "Disabled" }; (in the correct order) constant here and index by the array (and maybe an assert to catch out of bounds access if/when adds an entry and forgets to update this list).
This is typically more readable then a long switch case like this, but idk other people's opinions.

Loading

Copy link
Contributor

@tschatzl tschatzl Apr 29, 2021

Choose a reason for hiding this comment

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

And of course it's not a particular important suggestion, feel free to ignore.

Loading

Copy link
Member Author

@DamonFool DamonFool Apr 29, 2021

Choose a reason for hiding this comment

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

Maybe consider to have a static const char* strings[] = {"Enabled", "Unsupported", "Disabled" }; (in the correct order) constant here and index by the array (and maybe an assert to catch out of bounds access if/when adds an entry and forgets to update this list).
This is typically more readable then a long switch case like this, but idk other people's opinions.

Thanks @tschatzl for your review.

I didn't think of this skill before.
Thanks for your teaching.

Let's just keep it this time since there are only 3 cases for _state.
And I'd like to use your style of code next time.

Thanks.
Best regards,
Jie

Loading

Copy link
Contributor

@pliden pliden Apr 29, 2021

Choose a reason for hiding this comment

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

I'd like to keep the current proposal, since it's more inline with what we do in other places in ZGC, like ZLargePages::to_string().

Loading

pliden
pliden approved these changes Apr 29, 2021
Copy link
Contributor

@pliden pliden left a comment

Looks good.

Loading

log_info_p(gc, init)("NUMA Nodes: %u", count());
}
}

const char* ZNUMA::to_string() {
return _enabled ? "Enabled" : "Disabled";
switch (_state) {
Copy link
Contributor

@pliden pliden Apr 29, 2021

Choose a reason for hiding this comment

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

I'd like to keep the current proposal, since it's more inline with what we do in other places in ZGC, like ZLargePages::to_string().

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Apr 29, 2021

Looks good.

Thanks @pliden .

Loading

@DamonFool
Copy link
Member Author

@DamonFool DamonFool commented Apr 29, 2021

/integrate

Loading

@openjdk openjdk bot closed this Apr 29, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 29, 2021

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

  • 5d8c1cc: 8255410: Add ChaCha20 and Poly1305 support to SunPKCS11 provider
  • 46b4a14: 8266315: Problem list failing test java/awt/font/TextLayout/LigatureCaretTest.java
  • 42af7da: 8265933: Move Java monitor related fields from class Thread to JavaThread
  • 1afbab6: 8263998: Remove mentions of mc region in comments
  • 51b2fb5: 8266299: ProblemList runtime/stringtable/StringTableCleaningTest.java on linux-aarch64 with ZGC
  • 49d0458: 8266288: assert root method not found in witnessed_reabstraction_in_supers is too strong
  • 01415f3: 8266250: WebSocketTest and WebSocketProxyTest call assertEquals(List<byte[]>, List<byte[]>)
  • 5f15666: 8266078: Reader.read(CharBuffer) advances Reader position for read-only Charbuffers
  • 2a03739: 8266014: Regression brought by optimization done with JDK-4926314
  • 6bb71d9: 8264762: ByteBuffer.byteOrder(BIG_ENDIAN).asXBuffer.put(Xarray) and ByteBuffer.byteOrder(nativeOrder()).asXBuffer.put(Xarray) are slow
  • ... and 23 more: https://git.openjdk.java.net/jdk/compare/794cefe8f92ab0c9d5c7c5265232518e8ffb166a...master

Your commit was automatically rebased without conflicts.

Pushed as commit 5ecef01.

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

Loading

@DamonFool DamonFool deleted the JDK-8266217 branch Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants