Sitelet https://github.com/dotnet/runtime/pull/135022
Skip to content

Fix msl wait time extraction in GC - #135022

Merged
janvorli merged 1 commit into
dotnet:mainfrom
janvorli:fix-gc-size-adaptation-msl-wait-time
Oct 2, 2026
Merged

janvorli merged 1 commit into
dotnet:mainfrom
janvorli:fix-gc-size-adaptation-msl-wait-time

Conversation

@janvorli

@janvorli janvorli commented Oct 1, 2026

Copy link
Copy Markdown
Member

There is a bug in the gc_heap::get_msl_wait_time implementation that was introduced in .NET 9. The function has two output arguments soh_msl_wait_time and uoh_msl_wait_time, but instead of updating the values these args point to, it updates the args themselves. So it never reads out any value.

This change fixes it.

Close #134492

There is a bug in the gc_heap::get_msl_wait_time implementation that was
introduced in .NET 9. The function has two output arguments
soh_msl_wait_time and uoh_msl_wait_time, but instead of updating the
values these args point to, it updates the args themselves. So it never
reads out any value.

This change fixes it.

Close dotnet#134492
@janvorli
janvorli requested a review from kkokosa October 1, 2026 14:10
@janvorli janvorli self-assigned this Oct 1, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @anicka-net, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@janvorli
janvorli merged commit 097dbab into dotnet:main Oct 2, 2026
118 of 121 checks passed
@janvorli

janvorli commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@janvorli

janvorli commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@janvorli backporting to release/10.0 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git cherry-pick 097dbabb2ce276f44a682c7a29d345443f993239

CONFLICT (modify/delete): src/coreclr/gc/dynamic_heap_count.cpp deleted in HEAD and modified in 097dbabb2ce (Fix msl wait time extraction in GC (#135022)).  Version 097dbabb2ce (Fix msl wait time extraction in GC (#135022)) of src/coreclr/gc/dynamic_heap_count.cpp left in tree.
error: could not apply 097dbabb2ce... Fix msl wait time extraction in GC (#135022)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"


$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix msl wait time extraction in GC
Using index info to reconstruct a base tree...
A	src/coreclr/gc/dynamic_heap_count.cpp
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): src/coreclr/gc/dynamic_heap_count.cpp deleted in HEAD and modified in Fix msl wait time extraction in GC.  Version Fix msl wait time extraction in GC of src/coreclr/gc/dynamic_heap_count.cpp left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix msl wait time extraction in GC
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 3, 2026
JulieLeeMSFT pushed a commit that referenced this pull request Oct 5, 2026
Backport of #135022 to release/10.0

/cc @janvorli

## Customer Impact

- [x] Customer reported -
#134492
- [ ] Found internally

There is a bug in the `gc_heap::get_msl_wait_time` implementation that
was introduced in .NET 9. The function has two output arguments
`soh_msl_wait_time` and `uoh_msl_wait_time`, but instead of updating the
values these args point to, it updates the args themselves. So it never
reads out any value.
These values influence DATAS calculatation of throughput cost, which
influences Gen0 allocation budgets and heap count adaptation.

## Regression

- [x] Yes - introduced in .NET 9 by
#103405
- [ ] No

## Testing

Coreclr and libraries tests.

## Risk

Low, it is a trivial change that just fixes the extraction of msl wait
time values by get_msl_wait_time extracts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f6205bb0-b7d2-47d7-bf83-96ed19e7b932
JulieLeeMSFT pushed a commit that referenced this pull request Oct 5, 2026
Backport of #135022 to release/11.0

/cc @janvorli

## Customer Impact

- [x] Customer reported -
#134492
- [ ] Found internally

There is a bug in the `gc_heap::get_msl_wait_time` implementation that
was introduced in .NET 9. The function has two output arguments
`soh_msl_wait_time` and `uoh_msl_wait_time`, but instead of updating the
values these args point to, it updates the args themselves. So it never
reads out any value.
These values influence DATAS calculatation of throughput cost, which
influences Gen0 allocation budgets and heap count adaptation.

## Regression

- [x] Yes - introduced in .NET 9 by
#103405
- [ ] No

## Testing

Coreclr and libraries tests.

## Risk

Low, it is a trivial change that just fixes the extraction of msl wait
time values by get_msl_wait_time extracts.

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants