ARM64 currentCarrierThread intrinsic MO_ACQUIRE + @DontInline on Continuation.yield()#51
Open
macarte wants to merge 1 commit intomacarte/PR2-winarm64from
Open
ARM64 currentCarrierThread intrinsic MO_ACQUIRE + @DontInline on Continuation.yield()#51macarte wants to merge 1 commit intomacarte/PR2-winarm64from
macarte wants to merge 1 commit intomacarte/PR2-winarm64from
Conversation
…inuation.yield() On ARM64, after a virtual thread migrates between carriers, the OopHandle dereference for currentCarrierThread can be reordered with subsequent dependent loads (e.g. Thread.cont), observing stale data from the previous carrier. Add MO_ACQUIRE semantics to the OopHandle load in both the C1 (do_JavaThreadField) and C2 (current_thread_helper) intrinsics to ensure ordering. In C1, the barrier set's load_at_resolved did not honor MO_ACQUIRE for the membar_acquire emission — extend the check to cover both MO_SEQ_CST and MO_ACQUIRE decorators. Add @DontInline on Continuation.yield() and a @ChangesCurrentThread inlining guard in C1's should_not_inline() to prevent the compiler from inlining across carrier-change boundaries, which could allow the currentCarrierThread value to be cached across a yield point. This is a shared ARM64 correctness fix (not Windows-specific).
Author
|
results (not sure why some cancelled) |
Author
|
manual rerun results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ARM64 currentCarrierThread intrinsic MO_ACQUIRE + @DontInline on Continuation.yield()
On ARM64, after a virtual thread migrates between carriers, the OopHandle dereference for currentCarrierThread can be reordered with subsequent dependent loads (e.g. Thread.cont), observing stale data from the previous carrier. Add MO_ACQUIRE semantics to the OopHandle load in both the C1 (do_JavaThreadField) and C2 (current_thread_helper) intrinsics to ensure ordering.
In C1, the barrier set's load_at_resolved did not honor MO_ACQUIRE for the membar_acquire emission — extend the check to cover both MO_SEQ_CST and MO_ACQUIRE decorators.
Add @DontInline on Continuation.yield() and a @ChangesCurrentThread inlining guard in C1's should_not_inline() to prevent the compiler from inlining across carrier-change boundaries, which could allow the currentCarrierThread value to be cached across a yield point.
This is a shared ARM64 correctness fix (not Windows-specific).