Skip to content
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

Clearing all cards for free regions #77224

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Conversation

cshung
Copy link
Member

@cshung cshung commented Oct 19, 2022

This change fixed two issues associated with card table clearing.

When we return a region to the free region list, we can clear the cards.

If we use heap_segment_mem (region), this will always be 0x20 bytes after the start of the page. The align_on_card logic inside clear_card_for_addresses will skip resetting the card for the first page.

Before these fixes, #76801 is always failing with *card_word == 1. This is because the initial card (i.e. the least significant bit) cannot be reset because of the alignment.

After these fixes, the test case no longer fails locally after running for 4 hours in a loop.

@cshung cshung requested a review from Maoni0 October 19, 2022 17:15
@cshung cshung self-assigned this Oct 19, 2022
@ghost
Copy link

ghost commented Oct 19, 2022

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

Issue Details

This change fixed two issues associated with card table clearing.

When we return a region to the free region list, we can clear the cards.

If we use heap_segment_mem (region), this will always be 0x20 bytes after the start of the page. The align_on_card logic inside clear_card_for_addresses will skip resetting the card for the first page.

Before these fixes, #76801 is always failing with *card_word == 1. This is because the initial card (i.e. the least significant bit) cannot be reset because of the alignment.

After these fixes, the test case is still failing, but it is no longer failing for the same reason, in particular, *card_word != 1 when it fails.

Author: cshung
Assignees: cshung
Labels:

area-GC-coreclr

Milestone: -

@Maoni0
Copy link
Member

Maoni0 commented Oct 20, 2022

as we chatted about, let's change allocated to reserved.

@cshung cshung merged commit 4708ca8 into dotnet:main Oct 21, 2022
@cshung cshung deleted the public/clear-cards branch October 21, 2022 03:39
@ghost ghost locked as resolved and limited conversation to collaborators Nov 25, 2022
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