fix for largepages with agressive decommit logic#126929
fix for largepages with agressive decommit logic#126929mangod9 wants to merge 1 commit intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/gc |
There was a problem hiding this comment.
Pull request overview
Fixes a GC heap-corruption scenario when GCLargePages is enabled and an induced Aggressive GC triggers “decommit” bookkeeping that doesn’t actually decommit at the OS level for large pages. The change ensures the memory that is treated as decommitted is explicitly cleared so stale references can’t be observed later.
Changes:
- In the induced-aggressive path of
gc_heap::distribute_free_regions, clear the region tail that would normally be decommitted/zeroed by the OS. - Gate the clearing to
use_large_pages_p, since only large pages makevirtual_decommita no-op while still updating GC bookkeeping.
|
@mangod9 I believe this change should get in as is. But I wonder if it would be better to integrate the clearing of used part of the large page into the |
clear decommitted memory in the largepages scenario. Fixes #126903