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

8253030: ZGC: Change ZMarkCompleteTimeout unit to microseconds #120

Closed
wants to merge 1 commit into from

Conversation

pliden
Copy link
Contributor

@pliden pliden commented Sep 10, 2020

The ZMarkCompleteTimeout is currently specified in milliseconds, and its value is 1 (i.e. as low as it can be). In preparation for using a lower time out value than 1ms we should change the ZMarkCompleteTimeout unit to be microseconds, instead of milliseconds.


Progress

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

Issue

  • JDK-8253030: ZGC: Change ZMarkCompleteTimeout unit to microseconds

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/120/head:pull/120
$ git checkout pull/120

@pliden pliden changed the title 8253030: Mark timeout 8253030: ZGC: Change ZMarkCompleteTimeout unit to microseconds Sep 10, 2020
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 10, 2020

👋 Welcome back pliden! 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 10, 2020

@pliden 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 (add|remove) "label" command.

@pliden
Copy link
Contributor Author

pliden commented Sep 10, 2020

/cc hotspot-gc

@openjdk
Copy link

openjdk bot commented Sep 10, 2020

@pliden
The hotspot-gc label was successfully added.

@pliden
Copy link
Contributor Author

pliden commented Sep 10, 2020

/cc remove hotspot

@openjdk
Copy link

openjdk bot commented Sep 10, 2020

@pliden
The hotspot label was successfully removed.

@pliden pliden marked this pull request as ready for review September 10, 2020 21:09
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 10, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 10, 2020

Webrevs

Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

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

Change looks good. But I wonder, why choose microseconds as the units? That seems to be almost never used in HotSpot.

@openjdk
Copy link

openjdk bot commented Sep 11, 2020

@pliden This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8253030: ZGC: Change ZMarkCompleteTimeout unit to microseconds

Reviewed-by: kbarrett, stefank, eosterlund
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 19 commits pushed to the master branch:

  • f978f6f: 8252689: Classes are loaded from jrt:/java.base even when CDS is used
  • c5e63b6: 8248186: Move CDS C++ vtable code to cppVtables.cpp
  • 03a4df0: 8244778: Archive full module graph in CDS
  • 998ce78: 8252543: [JVMCI] Libgraal can deadlock in blocking compilation mode
  • b1b0f0b: 8253066: typo in Stream.mapMulti
  • 306b166: 8253033: CheckUnhandledOops check fails in ThreadSnapshot::initialize…
  • 5c0d985: 8253060: remove test/hotspot/jtreg/test_env.sh
  • 9525186: 8253031: git jcheck complains about invalid tags in jdk repo after fix for JDK-8252844
  • 7f27d0b: 8236142: DocTrees should provide getCharacters(EntityTree)
  • e7a1b9b: 8252981: ObjectMonitor::object() cleanup changes extracted from JDK-8247281
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/44a74dac957ca7cc10eaddafb6bd32b74a8d84c8...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate f978f6fe8ab57ab815f61dc0571df955db2663d5.

➡️ 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 Sep 11, 2020
@pliden
Copy link
Contributor Author

pliden commented Sep 11, 2020

@kimbarrett Thanks for reviewing. I used micros because it seems like the natural unit to use here. Using nanos seems a bit overkill, as we will never need that precision and it would just add a bunch of zeros to the constant, which I'm not sure would help readability. What unit did you have in mind?

Copy link
Contributor

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

@mlbridge
Copy link

mlbridge bot commented Sep 11, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

On Sep 11, 2020, at 5:52 AM, Per Lid?n <pliden at openjdk.java.net> wrote:

On Fri, 11 Sep 2020 01:16:34 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

The ZMarkCompleteTimeout is currently specified in milliseconds, and its value is 1 (i.e. as low as it can be). In
preparation for using a lower time out value than 1ms we should change the ZMarkCompleteTimeout unit to be
microseconds, instead of milliseconds.

Change looks good. But I wonder, why choose microseconds as the units? That seems to be almost never used in HotSpot.

@kimbarrett Thanks for reviewing. I used micros because it seems like the natural unit to use here. Using nanos seems a
bit overkill, as we will never need that precision and it would just add a bunch of zeros to the constant, which I'm
not sure would help readability. What unit did you have in mind?

Nanos would have been my choice, since that's widely used. The configuration
isn't user-facing, so some extra zeros doesn't seem important to me. But I
don't feel strongly about it; it just seemed an odd choice to me, since micros are
so rarely used elsewhere in our code.

I?ll go click the reviewed button now.

@pliden
Copy link
Contributor Author

pliden commented Sep 14, 2020

/integrate

@openjdk openjdk bot closed this Sep 14, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 14, 2020
@openjdk
Copy link

openjdk bot commented Sep 14, 2020

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

  • f978f6f: 8252689: Classes are loaded from jrt:/java.base even when CDS is used
  • c5e63b6: 8248186: Move CDS C++ vtable code to cppVtables.cpp
  • 03a4df0: 8244778: Archive full module graph in CDS
  • 998ce78: 8252543: [JVMCI] Libgraal can deadlock in blocking compilation mode
  • b1b0f0b: 8253066: typo in Stream.mapMulti
  • 306b166: 8253033: CheckUnhandledOops check fails in ThreadSnapshot::initialize…
  • 5c0d985: 8253060: remove test/hotspot/jtreg/test_env.sh
  • 9525186: 8253031: git jcheck complains about invalid tags in jdk repo after fix for JDK-8252844
  • 7f27d0b: 8236142: DocTrees should provide getCharacters(EntityTree)
  • e7a1b9b: 8252981: ObjectMonitor::object() cleanup changes extracted from JDK-8247281
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/44a74dac957ca7cc10eaddafb6bd32b74a8d84c8...master

Your commit was automatically rebased without conflicts.

Pushed as commit 07da3a1.

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

@pliden pliden deleted the 8253030_mark_timeout branch September 14, 2020 07:59
robehn pushed a commit to robehn/jdk that referenced this pull request Aug 15, 2023
It would install to /rivos/jdk/jdk instead of /rivos/jdk
fg1417 added a commit to fg1417/jdk that referenced this pull request Jul 12, 2024
…g to pointer

In the cases like:
```
  UNSAFE.putLong(address + off1 + 1030, lseed);
  UNSAFE.putLong(address + 1023, lseed);
  UNSAFE.putLong(address + off2 + 1001, lseed);
```

Unsafe intrinsifies direct memory access using a long as
the base address, generating a `CastX2P` node converting
long to pointer in C2. Then we get optoassembly code like:
```
  ldr  R10, [R15, openjdk#120]    # int ! Field: address
  ldr  R11, [R16, openjdk#136]    # int ! Field: off1
  ldr  R12, [R16, openjdk#144]    # int ! Field: off2
  add  R11, R11, R10
  mov R11, R11    # long -> ptr
  add  R12, R12, R10
  mov R10, R10    # long -> ptr
  add R11, R11, openjdk#1030    # ptr
  str  R17, [R11]    # int
  add R10, R10, openjdk#1023    # ptr
  str  R17, [R10]    # int
  mov R10, R12    # long -> ptr
  add R10, R10, openjdk#1001    # ptr
  str  R17, [R10]    # int
```

In aarch64, the conversion from long to pointer could be
a nop but C2 doesn't know it. On the existing code, we
do nothing for `mov dst src` only when `dst` == `src` [1],
then we have assembly:
```
  ldr    x10, [x15,openjdk#120]
  ldp    x11, x12, [x16,openjdk#136]
  add    x11, x11, x10
  add    x12, x12, x10
  add    x11, x11, #0x406
  str    x17, [x11]
  add    x10, x10, #0x3ff
  str    x17, [x10]
  mov    x10, x12  <--- extra register copy
  add    x10, x10, #0x3e9
  str    x17, [x10]
```

There is still one extra register copy, which we're trying
to remove in this patch.

This patch folds `CastX2P` into memory operands by introducing
`indirectX2P` and `indOffX2P`. We also create a new opclass
`iRegPorL2P` to remove extra copies from `CastX2P` in pointer
addition.

Tier 1~3 passed on aarch64. No obvious change in size
of libjvm.so

[1] https://github.com/openjdk/jdk/blob/5c612c230b0a852aed5fd36e58b82ebf2e1838af/src/hotspot/cpu/aarch64/aarch64.ad#L7906
pfirmstone added a commit to pfirmstone/jdk-with-authorization that referenced this pull request Nov 18, 2024
…/jgdms-jeri/junit-junit-4.13.1

Bump junit from 4.6 to 4.13.1 in /JGDMS/jgdms-jeri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc [email protected] integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants