Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[release/8.0-staging] improve distribute_free_regions #115023

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

Merged
merged 7 commits into from
May 6, 2025

Conversation

mangod9
Copy link
Member

@mangod9 mangod9 commented Apr 24, 2025

Port change for better free-list management. This is a back port of #109431

Customer Impact

  • Customer reported
  • Found internally

Memory utilization regression as part of Regions Enablement. Reported by a customer here: #103582.
The fix is to improve distribute_free_regions where aged regions are added to decommit list to ultimately free.

Regression

  • Yes
  • No

Yes in memory utilization. For certain customers who were running with dense containers they would observe an OOM occasionally.

Testing

Verified with internal performance testing. Provided a private to the customer to try out and they confirmed their memory utilization improved after the fix.

Risk

Low, this only impacts how free regions are deallocated.

@mangod9 mangod9 added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) area-GC-coreclr labels Apr 24, 2025
@Copilot Copilot AI review requested due to automatic review settings April 24, 2025 22:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ports distributed free list functionality from .NET 10 and adjusts related GC region management constants.

  • Updates the enum free_region_kind with new indices to support distributed free regions.
  • Adds new GC heap methods for distributing and manipulating free regions.
  • Introduces distinct decommit age thresholds for basic, large, and huge free regions.

Copy link
Contributor

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

@mangod9 mangod9 marked this pull request as draft April 24, 2025 22:45
@mangod9 mangod9 marked this pull request as ready for review April 29, 2025 20:34
@mangod9 mangod9 removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 29, 2025
@mangod9 mangod9 requested a review from Maoni0 April 29, 2025 23:04
@mangod9 mangod9 changed the title [DRAFT] GC Distribute Free list port from .NET 10 GC Distribute Free list port from .NET 10 Apr 29, 2025
@Maoni0
Copy link
Member

Maoni0 commented Apr 30, 2025

in distribute_free_regions

if (settings.reason == reason_induced_aggressive)
{

so this is not from Mark's change but a separate PR: #96513 that I think we should include this line in this if block -

global_regions_to_decommit[huge_free_region].transfer_regions (&global_free_huge_regions);


Refers to: src/coreclr/gc/gc.cpp:13342 in 40807e6. [](commit_id = 40807e6, deletion_comment = False)

@Maoni0
Copy link
Member

Maoni0 commented Apr 30, 2025

you might as well change this in decide_on_decommit_strategy

size_t decommit_step_milliseconds = min (ephemeral_elapsed, (10 * 1000));

to
size_t decommit_step_milliseconds = min (ephemeral_elapsed, (size_t)(10 * 1000));
in `distribute_freesame as in .net 9 and 10


Refers to: src/coreclr/gc/gc.cpp:13841 in 40807e6. [](commit_id = 40807e6, deletion_comment = False)

Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. we will take for consideration in 8.0.x

@jeffschwMSFT jeffschwMSFT changed the title GC Distribute Free list port from .NET 10 [release/8.0-staging] improve distribute_free_regions May 6, 2025
@rbhanda rbhanda modified the milestones: 8.0.x, 8.0.17 May 6, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels May 6, 2025
@mangod9 mangod9 merged commit f9239a1 into release/8.0-staging May 6, 2025
119 of 126 checks passed
@mangod9 mangod9 deleted the free_list_port branch May 6, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-GC-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants