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

8255401: Shenandoah: Allow oldval and newval registers to overlap in cmpxchg_oop() #871

Closed
wants to merge 1 commit into from

Conversation

rkennke
Copy link
Contributor

@rkennke rkennke commented Oct 26, 2020

We encountered a failure in testing:

Internal Error (/home/jenkins/workspace/nightly/jdk-jdk/src/hotspot/share/asm/register.hpp:141), pid=15470, tid=15611
assert(a != b && a != c && a != d && b != c && b != d && c != d) failed: registers must be different: a=0x0000000000000000, b=0x0000000000000000, c=0x000000000000000b, d=0x000000000000000a

in:

Stack: [0x00007fb8fa2e3000,0x00007fb8fa3e4000], sp=0x00007fb8fa3deca0, free space=1007k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x156890e] ShenandoahBarrierSetAssembler::cmpxchg_oop(MacroAssembler*, RegisterImpl*, Address, RegisterImpl*, RegisterImpl*, bool, RegisterImpl*, RegisterImpl*)+0xde
V [libjvm.so+0x3ec1d1] compareAndSwapN_shenandoahNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x571

It seems to appear very rarely.

The failure is that both newval and oldval are the same register (rax). I believe it is ok for the two registers to overlap:

  • It is not expected that newval is preserved across the cmpxchg
  • The CAS will override newval, but:
    • The first CAS is unaffected by the overlap
    • The retry-loop is only entered when previous-value == old-value, and thus newval will still hold the same value

For aarch64 it matters even less, because newval is never overridden.

Testing: hotspot_gc_shenandoah (x86 & aarch64).


Progress

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

Testing

Linux x32 Linux x64 Windows x64 macOS x64
Build ✔️ (1/1 passed) ✔️ (5/5 passed) ❌ (1/2 failed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed)

Failed test task

Issue

  • JDK-8255401: Shenandoah: Allow oldval and newval registers to overlap in cmpxchg_oop()

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 26, 2020

👋 Welcome back rkennke! 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 added the rfr Pull request is ready for review label Oct 26, 2020
@openjdk
Copy link

openjdk bot commented Oct 26, 2020

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

  • hotspot
  • shenandoah

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 shenandoah shenandoah-dev@openjdk.org labels Oct 26, 2020
@mlbridge
Copy link

mlbridge bot commented Oct 26, 2020

Webrevs

Copy link
Contributor

@rwestrel rwestrel 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

@openjdk
Copy link

openjdk bot commented Nov 2, 2020

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

8255401: Shenandoah: Allow oldval and newval registers to overlap in cmpxchg_oop()

Reviewed-by: roland

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

➡️ 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 Nov 2, 2020
@rkennke
Copy link
Contributor Author

rkennke commented Nov 2, 2020

/integrate

@openjdk openjdk bot closed this Nov 2, 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 Nov 2, 2020
@openjdk
Copy link

openjdk bot commented Nov 2, 2020

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

Your commit was automatically rebased without conflicts.

Pushed as commit 0e19ded.

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

openjdk-notifier bot referenced this pull request Nov 2, 2020
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 shenandoah shenandoah-dev@openjdk.org
2 participants