-
Notifications
You must be signed in to change notification settings - Fork 206
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
Initial hot cold splitting support for crossgen2/VM #1900
Initial hot cold splitting support for crossgen2/VM #1900
Conversation
5280674
to
4e17526
Compare
4e17526
to
3ce1cd5
Compare
...tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodColdCodeNode.cs
Show resolved
Hide resolved
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.
This is a good start. Let's get it merged so we can enable collaboration.
Added #1913 |
Have you followed all the instructions on https://github.com/dotnet/runtimelab/blob/docs/CreateAnExperiment.md to make this a "proper" runtimelab feature branch? |
I merged the PR for now, feel free to work on top of it. |
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.
I have added some feedback that should be ultimately addressed by the final implementor of hot-cold code splitting in Crossgen2 (Eugenio); in general the code changes seem reasonable to me, thanks Andrew for providing our intern with such a great head start!
Looked at all things I can think of - looks fine to me |
The instructions also suggest deleting |
This PR marks the start of the work to get crossgen2 to support hot/cold splitting.
Here are the changes:
Scratch
, to be described in (13) below for more detail._methodColdCode
from_coldCode
and_coldCodeRelocs
duringPublishCode
._methodColdCode
and empty_coldCodeRelocs
duringCompileMethodCleanup
._methodColdCode
duringallocMem
.reserveUnwindInfo
to ignore unwind reservation forcoldCode
.allocUnwindInfo
to ignore unwindInfo allocation for 0 bytes.findKnownBlocks
to return_coldCodeReloc
whenBlockType.ColdCode
is asked for.recordRelocation
to setrelocTarget
to_methodColdCodeNode
whenBlockType.ColdCode
is asked for.MethodColdCodeNode
MethodGCInfoNode
toCalculateFuncletOffsets
so that the offset for the cold code chained unwind info is included if it exists.MethodWithGCInfo
to:MethodColdCodeNode
.GetFixupBlob
to include relocation for the cold code.RuntimeFunctionTableNode
to:ScratchNode
.ScratchNode
- the session is simply an array of cold code runtime function index to hot code runtime function index, so all even entries (e.g. 0, 2, 4) are cold code runtime function index and the corresponding odd indexes (e.g. 1, 3, 5) are the corresponding runtime function index for the corresponding hot code. The array is sorted by the cold code indexes, by (9), the hot code indexes should be sorted as well.--hot-cold-splitting
command-line option, and turn on theCORJIT_FLAG_PROCSPLIT
flag as needed.JitCodeToMethodInfo
already gave us a runtime function index, we do not know if it is hot or cold, so we use the scratch table to find it. If we got an even index, that would be cold code and therefore we map it back to the hot one.GetFuncletStartOffsets
to return the cold code block as well - technically the cold block is not a funclet, but it appears that the debugger might want it.IsFunclet
so that it avoids returningtrue
for the cold code block, by searching the scratch table.JitTokenToMethodRegionInfo
so that it will find and return the cold code block - again, by search the scratch table since we already have the hot part runtimeFunction.DebugDebugger
so that it usesEECodeInfo
to compute relative offset instead of a simple subtraction, that will allow us to account for the cold code.This work is far from complete - here is a list of issues filed for the project - these are known issues for now:
@amanasifkhalid, @BruceForstall
@dotnet/crossgen-contrib