-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable multiple nested "no GC" region requests #68105
Enable multiple nested "no GC" region requests #68105
Conversation
When doing fast tail call on arm32, we disable GC reporting. But some IR nodes, like unrolled STORE_BLK, also disable GC reporting. If one of those is within a fast tail call argument setup region, we'll attempt to disable GC reporting twice. Since we didn't keep track of nesting, we end up marking some of the tail call region after the STORE_BLK as interruptible, leading to be GC info in the argument area. Change the enable/disable GC calls to keep a nesting count, and only re-enable GC reporting when the count reaches zero. Fixes dotnet#67046
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsWhen doing fast tail call on arm32, we disable GC reporting. Change the enable/disable GC calls to keep a nesting count, Fixes #67046 Also, don't remove GT_NO_OP "non-removable" NOP. These were being
|
@jakobbotsch @dotnet/jit-contrib PTAL |
/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr gcstress0x3-gcstress0xc |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for tracking this down.
Do you know why this only happens on ARM32? Do we not use STORE_BLK for args on other platforms as well?
It should happen on any non-x86 platform. It's possible that there are reasons why this particular case didn't get optimized quite right. It also requires a GC to actually happen in exactly the right place to be noticed. I'm not sure why GCStress doesn't make it happen reliably, and in fact in my testing, setting GCStress made the failure not happen. |
If I remove the "NO_OP" change and run asm diffs, I don't see any diffs on win-x64 or win-arm64, but I do see about a dozen on linux-x64 where we extend the no-GC range (as would be expected). (examples for libraries.crossgen2.Linux.x64:
and libraries_tests:
) (looks like there's a problem running spmi replay on linux-arm: we run out of memory and crash) |
Most gcstress failures are #68112 |
The NOP change is triggering an x86 GCStress=C failure in baseservices\threading\generics\Monitor\EnterExit12\EnterExit12.dll:
|
cc176b6
to
fd9d787
Compare
I'm going to split out the NOP change to a separate PR. |
/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr gcstress0x3-gcstress0xc |
Azure Pipelines successfully started running 3 pipeline(s). |
When doing fast tail call on arm32, we disable GC reporting. But some IR nodes, like unrolled STORE_BLK, also disable GC reporting. If one of those is within a fast tail call argument setup region, we'll attempt to disable GC reporting twice. Since we didn't keep track of nesting, we end up marking some of the tail call region after the STORE_BLK as interruptible, leading to be GC info in the argument area. Change the enable/disable GC calls to keep a nesting count, and only re-enable GC reporting when the count reaches zero. Fixes dotnet#67046
When doing fast tail call on arm32, we disable GC reporting.
But some IR nodes, like unrolled STORE_BLK, also disable GC
reporting. If one of those is within a fast tail call argument
setup region, we'll attempt to disable GC reporting twice. Since
we didn't keep track of nesting, we end up marking some of the
tail call region after the STORE_BLK as interruptible, leading
to be GC info in the argument area.
Change the enable/disable GC calls to keep a nesting count,
and only re-enable GC reporting when the count reaches zero.
Fixes #67046
Also, don't remove GT_NO_OP "non-removable" NOP. These were being
removed by liveness. They were being inserted in at least some cases
by fast tail call code to ensure there was at least one instruction in a
function that was GC interruptible. All the diffs are due to this.