- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Cleanup after GC info version update. #108117
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
Conversation
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| I think this is ready for review. | 
| { | ||
| _ASSERTE(!nativeCodeVersion.IsNull()); | ||
|  | ||
| // CONSIDER: does anyone call this with fZapped == true ? are there plans? | 
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.
Zap was a code name for fragile NGen.
Does the GC stress instrumentation work for R2R code? If it does, this flag can be deleted. If it does not, what needs to happen to enable the GC stress instrumentation for R2R code?
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 two theories - either R2R code comes on the JIT path (and JIT does not really JIT much, maybe some fixups), then we could remove fZapped  path as a part this change.
Or we do not stress R2R. There is nothing that would make that impossible, I think R2R code is writeable in the same sense as JIT code is writeable. Enabling stress over R2R would be a separate change though.
I will check what happens with R2R.
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| @VSadov I wonder if it would be possible to reorder stuff in the gccover.cpp so that the diff github shows would make sense. Looking at it now, it is very difficult to see what was changed and what was just moved. | 
| 
 Some of that is because a few functions make sense only for x86, and a few are very different between x86 and "the rest", so I brought x86-specific parts closer to each other under one  | 
9f4ef71    to
    eccfbae      
    Compare
  
    | /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| // 5) Now, thread T can modify the stack (ex: RedirectionFrame setup) while the GC thread is scanning it. | ||
| // | ||
| // This race is now mitigated below. Where we won't initiate a stress mode GC | ||
| // for a thread in cooperative mode with an active ICF, if g_TrapReturningThreads is true. | 
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.
The original explanation for the g_TrapReturningThreads + active ICF scenario causing a race was somewhat questionable, so I initially removed the mitigation, but the race appears to be real.
Corrected the explanation of how the race may happen and brought the mitigation back.
| 
 It does not look like we instrument R2R code for GC stress. The instrumentation ( I will log a follow-up issue. We should be able to GC-stress R2R code. (#108117) | 
| 
 @janvorli - We had a lot of platform specific code and now a lot of that is gone, while X86 specific code is still in. Moving code roughly to where it was resulted in many  I tried to move code around to reduce diffs, but it made things mostly worse. The diffs were still big enough that VS differ could not make a lot of sense of it (I assume github diff will not be any better). So basically the rearrangements were making the file harder to read without much improvement to the diff. The code that I moved generally stayed the same, modulo removing dead code. I was particularly careful that X86 code path did not change. In couple places I made separate X86 and non-X86 copies ( I think the easiest way to review this file is basically by reading the new code, and when in doubt finding old version and check with that. I think the most "interesting" part is that AMD64 code path is now merged with ARM,RISC-V,etc.. and not a part of X86 path. The part that the stress runs are green and take roughly the same time as before give me a good deal of confidence that the code is functionally the same as before. | 
| Rebased onto recent main. | 
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 pipeline(s). | 
| /azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc | 
| Azure Pipelines successfully started running 2 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, thank you!
| Thanks!! | 
There should not be any functional changes. The most affected part is GC stress as there is a lot of dead code there now.
Some code moved around to tease apart reachable and unreachable scenarios.
I.E. the figuring the targets of calls and what they may return is no longer needed on non-X86 - neither at instrumentation time nor at fault time.