Skip to content

Making sure we have at least one region per gen during plan phase #83076

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 2 commits into from
Apr 22, 2023

Conversation

Maoni0
Copy link
Member

@Maoni0 Maoni0 commented Mar 7, 2023

Currently we can get into the situation that we didn't have at least one region in each generation we
need to plan. And most of the time we are getting away with it because we can just get a new region
in thread_final_regions. But if we can't, it's a functional problem because we will not maintain our
at least one region per generation invariant.

This change keeps how many regions are planned in each generation and if needed we will attempt to get
new regions during plan phase. And if we can't we will go into the special sweep mode.

When we demote regions with only pinned surv, we detect the ones with no surv at all - those can be
freely planned into any generation we need. We could actually plan regions with only pinned surv to
any generation, eg, we could promote a gen0 region to gen2. However it means we'd need to set cards
on those pinned objects because we will not have a chance later. The benefit of doing this is small
in general as when we get into process_remaining_regions, it's rare we don't already have planned regions
in higher generations. So I don't think it's worth the complexicity for now. We may consider it for the future.

@ghost ghost added the area-GC-coreclr label Mar 7, 2023
@ghost ghost assigned Maoni0 Mar 7, 2023
@ghost
Copy link

ghost commented Mar 7, 2023

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

Issue Details

null

Author: Maoni0
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

@Maoni0 Maoni0 added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Mar 7, 2023
@Maoni0 Maoni0 force-pushed the fix_hang_80073_fix2 branch 2 times, most recently from 401d828 to 82c114c Compare April 13, 2023 07:30
@Maoni0 Maoni0 changed the title WIP reworked how the demotion logic should work in process_remaining_regions Making sure we have at least one region per gen during plan phase Apr 13, 2023
@Maoni0 Maoni0 removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 13, 2023
Currently we can get into the situation that we didn't have at least one region in each generation we
need to plan. And most of the time we are getting away with it because we can just get a new region
in thread_final_regions. But if we can't, it's a functional problem because we will not maintain our
at least one region per generation invariant.

This change keeps how many regions are planned in each generation and if needed we will attempt to get
new regions during plan phase. And if we can't we will go into the special sweep mode.

When we demote regions with only pinned surv, we detect the ones with no surv at all - those can be
freely planned into any generation we need. We could actually plan regions with only pinned surv to
any generation, eg, we could promote a gen0 region to gen2. However it means we'd need to set cards
on those pinned objects because we will not have a chance later. The benefit of doing this is small
in general as when we get into process_remaining_regions, it's rare we don't already have planned regions
in higher generations. So I don't think it's worth the complexicity for now. We may consider it for the future.
@Maoni0 Maoni0 force-pushed the fix_hang_80073_fix2 branch from 82c114c to 167966f Compare April 13, 2023 07:44
@Maoni0
Copy link
Member Author

Maoni0 commented Apr 15, 2023

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@PeterSolMS PeterSolMS left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@Maoni0 Maoni0 merged commit 71d7f4b into dotnet:main Apr 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants