-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit 811da24
authored
fixing a regression in regions related to when we make threads that allocate UOH objects wait during a BGC (#118567)
+ don't apply that policy that says "if the begin UOH size is 2x the last gen2's UOH end size, always wait" for regions as it doesn't make sense - regions could have released a lot of memory to the UOH free lists in the last gen2 GC so it's not uncommon that the begin UOH size would be a lot larger than last gen2 GC's end size.
+ this kind of perf fixes can always regress someone. Due to the very different perf characteristics of regions wrt this, it's not practical to keep the original behavior for everyone. So I'm adding a config for scenarios that allocate heavily on UOH therefore can be paused during a BGC. If you're willing to accept larger UOH sizes in exchange for fewer pauses, you can use the UOHWaitBGCSizeIncPercent config to increase the wait ratio. Likewise, set it to use a smaller ratio if you observe that UOH grows too large during BGCs. I will be submitting a doc PR for this.
+ refactored various things kept separately for LOH and POH into UOH generations. I had a much more complicated fix before and having to update both generations was tedious so I took the opportunity to refactor. I didn't go with that fix (because it regressed edge cases too much and there wasn't a good way to make it work without way riskier changes. But I kept the refactoring changes as it just makes the code cleaner.
+ fixed how the current UOH size is computed so it's updated correctly (it had a racing condition as `bgc_uoh_alloc_clr` and `adjust_limit_clr` would release the msl).
+ got rid of the unproductive code in `new_allocation_allowed` and `allocate_uoh`.
+ misc - fixed an error in a comment related to how free regions are aged.
note that it's better to add additional diagnostics info (in a separate PR), to indicate how much the UOH size had changed since the start of that BGC and how much UOH allocation was made during the BGC. Right now the `size_before` we set for UOH is larger than it actually is.1 parent ce10f6f commit 811da24Copy full SHA for 811da24
File tree
Expand file treeCollapse file tree
3 files changed
+182
-167
lines changedFilter options
- src/coreclr/gc
Expand file treeCollapse file tree
3 files changed
+182
-167
lines changed
0 commit comments