-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix issue 41311 - Assert failure ephemeral_heap_segment->saved_committed == heap_segment_committed #41441
Merged
Merged
Fix issue 41311 - Assert failure ephemeral_heap_segment->saved_committed == heap_segment_committed #41441
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3d639f2
delete backport.yml so I can push to master
PeterSolMS fb423e8
Fix for issue 41311 - Assert failure ephemeral_heap_segment->saved_co…
PeterSolMS c78344e
Merge remote-tracking branch 'upstream/master'
PeterSolMS 0fc9aeb
Undo unintended changes
PeterSolMS 39891b2
Merge branch 'master' into Fix_issue_41311
PeterSolMS e450308
Address code review feedback, fix assert.
PeterSolMS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5705,6 +5705,7 @@ void gc_heap::gc_thread_function () | |
END_TIMING(suspend_ee_during_log); | ||
|
||
proceed_with_gc_p = TRUE; | ||
gradual_decommit_in_progress_p = FALSE; | ||
|
||
if (!should_proceed_with_gc()) | ||
{ | ||
|
@@ -11506,6 +11507,15 @@ BOOL gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* high_address, bool* | |
|
||
assert (heap_segment_committed (seg) <= heap_segment_reserved (seg)); | ||
assert (high_address <= heap_segment_committed (seg)); | ||
|
||
#ifdef MULTIPLE_HEAPS | ||
// we should never increase committed beyond decommit target when gradual | ||
// decommit is in progress - if we do, this means commit and decommit are | ||
// going on at the same time. | ||
assert (!gradual_decommit_in_progress_p || | ||
(seg != ephemeral_heap_segment) || | ||
(heap_segment_committed (seg) <= heap_segment_decommit_target (seg))); | ||
#endif // MULTIPLE_HEAPS | ||
} | ||
|
||
return !!ret; | ||
|
@@ -32458,7 +32468,7 @@ void gc_heap::trim_youngest_desired_low_memory() | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
nit
|
||
void gc_heap::decommit_ephemeral_segment_pages() | ||
{ | ||
if (settings.concurrent || use_large_pages_p) | ||
if (settings.concurrent || use_large_pages_p || (settings.pause_mode == pause_no_gc)) | ||
{ | ||
return; | ||
} | ||
|
@@ -32497,7 +32507,7 @@ void gc_heap::decommit_ephemeral_segment_pages() | |
decommit_target += target_decrease * 2 / 3; | ||
} | ||
|
||
heap_segment_decommit_target(ephemeral_heap_segment) = decommit_target; | ||
heap_segment_decommit_target (ephemeral_heap_segment) = decommit_target; | ||
|
||
#ifdef MULTIPLE_HEAPS | ||
if (decommit_target < heap_segment_committed (ephemeral_heap_segment)) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I must be missing something - isn't decommit_target smaller than committed? we keep shrinking committed till we reach decommit_tagert when we do the decommit steps.
also when gradual_decommit_in_progress_p is TRUE, shouldn't decommit_target always be non NULL?
nit -
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 some heaps, decommit_target may be bigger than committed, and that's fine - it just means that we won't decommit.
When gradual_decommit_in_progress_p is TRUE, decommit_target will be non NULL for the ephemeral_heap_segment, but may be NULL for other segments - the condition was meant to filter out the other segments. Now that I think about it, I realize this isn't a good test - I should compare against ephemeral_heap_segment directly. So I fixed the assert as follows:
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.
oh right, I was only thinking about eph seg. and yes the point is if we actually need to commit more, the decommit target had better be bigger otherwise we have a problem. thanks! I agree the new assert looks better.