Skip to content

Don't try and instrument methods that are not tiering eligible#120241

Merged
AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS:Fix120237
Sep 30, 2025
Merged

Don't try and instrument methods that are not tiering eligible#120241
AndyAyersMS merged 1 commit intodotnet:mainfrom
AndyAyersMS:Fix120237

Conversation

@AndyAyersMS
Copy link
Member

Under certain stress modes the JIT may enable PGO instrumentation even if the VM has not asked for it. On the VM side, block these attempts for methods that are not tiering eligible by ensuring that schema allocation requests immediately fail.

Fixes #120237

Under certain stress modes the JIT may enable PGO instrumentation
even if the VM has not asked for it. On the VM side, block these
attempts for methods that are not tiering eligible by ensuring
that schema allocation requests immediately fail.

Fixes dotnet#120237
Copilot AI review requested due to automatic review settings September 30, 2025 02:08
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prevents the JIT from attempting to instrument methods that are not eligible for tiered compilation when PGO (Profile Guided Optimization) instrumentation is enabled. Under certain stress modes, the JIT might try to enable PGO instrumentation even when the VM hasn't requested it, which can cause issues.

Key changes:

  • Adds a check to verify method tiering eligibility before proceeding with PGO instrumentation
  • Returns E_NOTIMPL immediately for non-tiering-eligible methods to block unwanted instrumentation attempts

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr libraries-pgo

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

@EgorBo PTAL
FYI @dotnet/jit-contrib

This fixes most of the failures with this new stress mode. The remaining failures are #120170 and a small number of others I haven't analyzed yet.

Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

Under certain stress modes the JIT may enable PGO instrumentation even if the VM has not asked for it.

it sounds a little bit weird that JIT allows it to itself without the VM's permission, but I guess it allows us to keep the stress modes inside the JIT without expanding/moving it to VM

@AndyAyersMS AndyAyersMS merged commit d39715a into dotnet:main Sep 30, 2025
102 of 106 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assertion `(processingState & ~InstrumentationDataProcessingState::UpdateProcessMask) == InstrumentationDataProcessingState::Done'

3 participants