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

[release/8.0] JIT: Fix case where we illegally optimize away a memory barrier on ARM32 #91870

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 11, 2023

Backport of #91827 to release/8.0

/cc @jakobbotsch

Customer Impact

The JIT may optimize out the latter of two memory barrier if no store/load happens between them. This optimization may happen even if there is a call between the two memory barriers. This can result in illegal reordering of stores/loads happening inside the called function with other stores/loads happening after.
This bug fix has diffs in built-in BCL primitives like ConcurrentQueue and ThreadPool.

Testing

Verified that the affected test case no longer reproduces the issue within 1 hour (previously it was reproduced within a few minutes).

Risk

Low. This makes the optimization more conservative.

The ARM32/ARM64 backends have an optimization where they optimize out
the latter of two subsequent memory barriers if no memory store/load has
been seen between them. This optimization should not be allowed to
remove memory barriers when a call has been seen.

Fix #91732
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 11, 2023
@ghost
Copy link

ghost commented Sep 11, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #91827 to release/8.0

/cc @jakobbotsch

Customer Impact

Testing

Risk

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch jakobbotsch changed the title [release/8.0] JIT: Fix case where we illegally optimize away a memory barrier on ARM32/ARM64 [release/8.0] JIT: Fix case where we illegally optimize away a memory barrier on ARM32 Sep 11, 2023
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. this can be merged once ready

@jeffschwMSFT jeffschwMSFT added the Servicing-approved Approved for servicing release label Sep 11, 2023
@jeffschwMSFT jeffschwMSFT added this to the 8.0.0 milestone Sep 11, 2023
@jeffschwMSFT jeffschwMSFT merged commit 467e23f into release/8.0 Sep 11, 2023
110 of 115 checks passed
@jkotas jkotas deleted the backport/pr-91827-to-release/8.0 branch September 11, 2023 20:19
@radical radical mentioned this pull request Sep 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants