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

Add ee_alloc_context (NativeAOT) #104851

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Jul 30, 2024

  1. Add ee_alloc_context (NativeAOT)

    This change is some preparatory refactoring for the randomized allocation sampling feature. We need to add more state onto allocation context but we don't want to do a breaking change of the GC interface. The new state only needs to be visible to the EE but we want it physically near the existing alloc context state for good cache locality. To accomplish this we created a new ee_alloc_context struct which contains an instance of gc_alloc_context within it.
    
    The new ee_alloc_context::combined_limit should be used by fast allocation helpers to determine when to go down the slow path. Most of the time combined_limit has the same value as alloc_limit, but periodically we need to emit an allocation sampling event on an object that is somewhere in the middle of an AC. Using combined_limit rather than alloc_limit as the slow path trigger allows us to keep all the sampling event logic in the slow path.
    noahfalk committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    7a7b3a0 View commit details
    Browse the repository at this point in the history
  2. PR feedback

    - removed unnecessary UpdateCombinedLimit() in thread detach
    - updated comment for workaround on 96081
    - swapped to updating combined_limit inside GcEnumAllocContexts() instead of in RestartEE()
    noahfalk committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    690fca7 View commit details
    Browse the repository at this point in the history
  3. Update src/coreclr/nativeaot/Runtime/gcenv.ee.cpp

    Co-authored-by: Jan Kotas <jkotas@microsoft.com>
    noahfalk and jkotas committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    afbd98e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0b083a7 View commit details
    Browse the repository at this point in the history
  5. PR feedback

    -update the breaking change number on the debug header
    -remove unneeded whitespace
    -adjust combined_limit -> m_CombinedLimit
    noahfalk committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    bc70bf5 View commit details
    Browse the repository at this point in the history