-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Mark overflow fix for regions #60646
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
|
Tagging subscribers to this area: @dotnet/gc Issue DetailsIt is a prototype, it seems to work with a test case with mark overflow. Here are some highlights of what I changed:
This should work, but I am not certain about its perf impact. Depending on the exact situation, it may or may not outperform the range solution.
|
9a13ccc to
1b935bb
Compare
c8e512c to
45dec0f
Compare
Maoni0
left a comment
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.
sorry I didn't get to this yesterday like I said I would...
it might be worthwhile to think about some kind of formatting tool that can make the format for the #ifdef checks consistent so we don't have to go through formatting stuff.
otherwise LGTM. I still think there might be a problem on arm but it's fine to check this in - it might help us discover some problems on arm by CI (I doubt it though since very little is run with server GC in CI).
The change is supposed to change the behavior for
USE_REGIONSonly.Overall idea
We may not have a continuous small object heap, therefore I removed the
background_min_overflow_addressandbackground_max_overflow_address. Instead, I introduced new flag namedbackground_overflow_pto indicate a background mark stack overflow happened for the current heap, and the flagheap_segment_flags_overflowdefined on a region is repurposed to mean any regions that need mark overflow processing.Details:
When a background mark stack overflow happens. Instead of modifying the background overflow address range, we set the
heap_segment_flags_overflowflag on the corresponding region and thebackground_overflow_pflag on the corresponding heap.Without a range, we have to scan the whole region.
background_first_overflowis changed for regions so that it starts at the beginning of the region.The only important change in
background_process_mark_overflow_internalis that we are ignoring the input and settingcurrent_min_addandcurrent_max_addto the region's range whenheap_segment_flags_overflowflag is on and (0,0) otherwise. Other changes only affect dprintfs.In
background_process_mark_overflow, preprocessing for the concurrent case, we removed the logic of setting theheap_segment_flags_overflowfor ephemeral regions. The flag is no longer used for that purpose.In
background_process_mark_overflow, preprocessing for the non-concurrent case, we used thebackground_overflow_pflag instead of the range to detect a background mark stack overflow happened. The setting ofbackground_overflow_pflag to true unconditionally is a bit tricky. That is meant to make sure we process the ephemeral regions that we skipped earlier, there isn't a separate indicator for whether or not there was a mark overflow happened in the last on the ephemeral regions.The last change in
background_process_mark_overflowsimply pass (0, 0) as the range intobackground_process_mark_overflow_internal, the function will simply not use them.We skipped the logic to compute the overflow range in
background_scan_dependent_handlesand inbackground_mark_phase.Testing
The latest code is tested in the following configuration(s):