Skip to content

Clearing all cards for free regions - #77224

Merged
cshung merged 2 commits into
dotnet:mainfrom
cshung:public/clear-cards
Oct 21, 2022
Merged

cshung merged 2 commits into
dotnet:mainfrom
cshung:public/clear-cards

Conversation

@cshung

@cshung cshung commented Oct 19, 2022 •

Copy link
Copy Markdown
Contributor

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

ghost commented Oct 19, 2022

Copy link
Copy Markdown

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

Maoni0 commented Oct 20, 2022

Copy link
Copy Markdown
Member

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