-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Introducing Pinned Object Heap #32283
Conversation
VSadov
commented
Feb 14, 2020
•
edited
Loading
edited
- Not exposed through any API yet.
- Has some extra test code for stress coverage. Will be removed before merging.
@@ -2427,6 +2431,9 @@ static static_data static_data_table[latency_level_last - latency_level_first + | |||
// gen2 | |||
{256*1024, SSIZE_T_MAX, 200000, 0.25f, 1.2f, 1.8f, 100000, 100}, | |||
// loh | |||
{3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0}, | |||
// loh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be poh
? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, should be poh
.
Initial tuning is copied from loh
and may be adjusted further, if needed. The comment should say poh
though. #Resolved
I think this is ready for the review. |
In this iteration I am sending LOH allocations with 50/50 chance to POH - for testing purposes.
that passed too with I am fairly confident now that POH works and caused no regressions. |
great! I'll be reviewing this over the weekend; I already looked at the changes before so I would expect only small changes. |
@Maoni0 Thanks! The changes are indeed small, ~200 lines, and fairly mechanical too. |
src/coreclr/src/gc/gc.cpp
Outdated
@@ -20,6 +20,7 @@ | |||
#include "gcpriv.h" | |||
|
|||
#define USE_INTROSORT | |||
#define ALLOW_REFERENCES_IN_POH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be better in gcpriv.h which has all the feature related defines. the #define's in gc.cpp are purely implementation related, ie, you wouldn't expect someone to define or define them to enable a feature. #Resolved
{3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0} | ||
{3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0}, | ||
// poh | ||
// TODO: using same numbers as for LOH. May need to tune this (see: https://github.com/dotnet/runtime/issues/13739) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will need to be tuned so you could just say "TODO: tuning PR_link_from_GH #Resolved
@@ -2427,6 +2431,9 @@ static static_data static_data_table[latency_level_last - latency_level_first + | |||
// gen2 | |||
{256*1024, SSIZE_T_MAX, 200000, 0.25f, 1.2f, 1.8f, 100000, 100}, | |||
// loh | |||
{3*1024*1024, SSIZE_T_MAX, 0, 0.0f, 1.25f, 4.5f, 0, 0}, | |||
// loh | |||
// TODO: using same numbers as for LOH. May need to tune this (see: https://github.com/dotnet/runtime/issues/13739) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: using same numbers [](start = 8, length = 27)
same here. #Resolved
dprintf (3, ("Relocating cross generation pointers for large objects on heap %d", heap_number)); | ||
mark_through_cards_for_uoh_objects(&gc_heap::relocate_address, loh_generation, TRUE THIS_ARG); | ||
dprintf (3, ("Relocating cross generation pointers for uoh objects on heap %d", heap_number)); | ||
for(int i = uoh_start_generation; i < total_generation_count; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for(int [](start = 12, length = 7)
nit - formatting, needs a space between for and ( #Resolved
dprintf(3, ("Relocating cross generation pointers for large objects on heap %d", hp->heap_number)); | ||
hp->mark_through_cards_for_uoh_objects(&gc_heap::relocate_address, loh_generation, TRUE THIS_ARG); | ||
dprintf(3, ("Relocating cross generation pointers for uoh objects on heap %d", hp->heap_number)); | ||
for(int i = uoh_start_generation; i < total_generation_count; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for(int i [](start = 16, length = 9)
nit - same formatting, needs space #Resolved
src/coreclr/src/gc/gc.cpp
Outdated
@@ -33472,6 +33575,16 @@ CObjectHeader* gc_heap::allocate_large_object (size_t jsize, uint32_t flags, int | |||
return obj; | |||
} | |||
|
|||
CObjectHeader* gc_heap::allocate_large_object (size_t jsize, uint32_t flags, int64_t& alloc_bytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need these 2 methods at all instead of just calling allocate_uoh_object and passing in the right args? #Resolved
src/coreclr/src/gc/gcpriv.h
Outdated
@@ -3982,6 +3997,16 @@ class gc_heap | |||
PER_HEAP | |||
alloc_list gen2_alloc_list[NUM_GEN2_ALIST-1]; | |||
|
|||
// TODO: using same numbers as for LOH. May need to tune this (see: https://github.com/dotnet/runtime/issues/13739) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: using same numbers as for LOH. May need to tune [](start = 0, length = 57)
again, this will need to be tuned so I would not say "May need to tune" #Resolved
LGTM aside from some minor comments above! feel free to merge after those are addressed. |
Thanks!! |
Adding a link to the design doc for people looking at this PR. I didn't see it in the PR. https://github.com/dotnet/runtime/blob/master/docs/design/features/PinnedHeap.md |
Here is the other PR where POH was made available for use via public APIs: Just for reference and to link these two PRs together. |