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

Make sure separated_poh_p and use_large_pages_p works together #50665

Merged
merged 2 commits into from
Apr 9, 2021
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
20 changes: 19 additions & 1 deletion src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4964,6 +4964,16 @@ BOOL gc_heap::reserve_initial_memory (size_t normal_size, size_t large_size, siz
}
}

if (reserve_success && separated_poh_p)
{
for (int heap_no = 0; (reserve_success && (heap_no < num_heaps)); heap_no++)
cshung marked this conversation as resolved.
Show resolved Hide resolved
{
if (!GCToOSInterface::VirtualCommit(memory_details.initial_pinned_heap[heap_no].memory_base, pinned_size))
{
reserve_success = FALSE;
}
}
}

return reserve_success;
cshung marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down Expand Up @@ -6581,7 +6591,6 @@ bool gc_heap::virtual_decommit (void* address, size_t size, gc_oh_num oh, int h_

void gc_heap::virtual_free (void* add, size_t allocated_size, heap_segment* sg)
{
assert(!heap_hard_limit);
bool release_succeeded_p = GCToOSInterface::VirtualRelease (add, allocated_size);
if (release_succeeded_p)
{
Expand Down Expand Up @@ -11739,6 +11748,11 @@ 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)
{
heap_hard_limit_oh[poh] = min_segment_size_hard_limit * number_of_heaps;
cshung marked this conversation as resolved.
Show resolved Hide resolved
heap_hard_limit += heap_hard_limit_oh[poh];
}
#endif //USE_REGIONS

#ifdef CARD_BUNDLE
Expand Down Expand Up @@ -40125,6 +40139,10 @@ HRESULT GCHeap::Initialize()
{
return E_INVALIDARG;
}
if (!gc_heap::heap_hard_limit_oh[poh] && !GCConfig::GetGCLargePages())
{
return E_INVALIDARG;
}
gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[soh] +
gc_heap::heap_hard_limit_oh[loh] + gc_heap::heap_hard_limit_oh[poh];
}
Expand Down