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

[release/7.0] Update heap hard limit for large pages #81292

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13683,10 +13683,20 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
if (!reserve_initial_memory (soh_segment_size, loh_segment_size, poh_segment_size, number_of_heaps,
use_large_pages_p, separated_poh_p, heap_no_to_numa_node))
return E_OUTOFMEMORY;
if (separated_poh_p)
if (use_large_pages_p)
{
heap_hard_limit_oh[poh] = min_segment_size_hard_limit * number_of_heaps;
heap_hard_limit += heap_hard_limit_oh[poh];
if (heap_hard_limit_oh[soh])
{
heap_hard_limit_oh[soh] = soh_segment_size * number_of_heaps;
heap_hard_limit_oh[loh] = loh_segment_size * number_of_heaps;
heap_hard_limit_oh[poh] = poh_segment_size * number_of_heaps;
heap_hard_limit = heap_hard_limit_oh[soh] + heap_hard_limit_oh[loh] + heap_hard_limit_oh[poh];
}
else
{
assert (heap_hard_limit);
heap_hard_limit = (soh_segment_size + loh_segment_size + poh_segment_size) * number_of_heaps;
}
}
#endif //USE_REGIONS

Expand Down Expand Up @@ -45144,10 +45154,6 @@ HRESULT GCHeap::Initialize()

#endif //HOST_64BIT
GCConfig::SetGCLargePages(gc_heap::use_large_pages_p);
GCConfig::SetGCHeapHardLimit(static_cast<int64_t>(gc_heap::heap_hard_limit));
GCConfig::SetGCHeapHardLimitSOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[soh]));
GCConfig::SetGCHeapHardLimitLOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[loh]));
GCConfig::SetGCHeapHardLimitPOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[poh]));

uint32_t nhp = 1;
uint32_t nhp_from_config = 0;
Expand Down Expand Up @@ -45332,6 +45338,11 @@ HRESULT GCHeap::Initialize()
hr = gc_heap::initialize_gc (seg_size, large_seg_size, pin_seg_size);
#endif //MULTIPLE_HEAPS

GCConfig::SetGCHeapHardLimit(static_cast<int64_t>(gc_heap::heap_hard_limit));
GCConfig::SetGCHeapHardLimitSOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[soh]));
GCConfig::SetGCHeapHardLimitLOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[loh]));
GCConfig::SetGCHeapHardLimitPOH(static_cast<int64_t>(gc_heap::heap_hard_limit_oh[poh]));

if (hr != S_OK)
return hr;

Expand Down