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

Collector STW flag #5131

Merged
merged 1 commit into from
Apr 28, 2020
Merged

Collector STW flag #5131

merged 1 commit into from
Apr 28, 2020

Conversation

amicic
Copy link
Contributor

@amicic amicic commented Apr 28, 2020

Generalize the existing flag that was being set only in Concurrent
Global GC to being maintained by base Collector, so that can be used
for any STW Collector.

Specifically, it was needed in an unusual combination when Concurrent
Scavenger was enabled, but Concurrent Mark disabled (so Global GC was
not MM_ConcurrentGC, but MM_ParallelGlobalGC which would not set STW
flag), and when CS would abort and Global Marking would miss to fixup
forwarded slots (during STW phase).

In future, the flag might be useful for other code in CS & Balanced to
determine if GC threads running in STW or concurrent phase. But for that
we have to properly set it for cases when Master Threads is explicit.
This is better to do in a separate change, if/when it becomes important.
For now, this flag is reliable only any STW GC with implicit Master
Thread.

This is a slightly adjusted variant of
#5112 that had a problem with setting
this flag before completeExternalConcurrentCycle(). While in theory that
would be ok, heap resizing code in ConcurrentGC would (somewhat
incorrectly) rely on _stwCollectionInProgress being now true to conclude
that resizing request was not coming from overlapping Scavenger
(thinking that it's not possible that both Global and Scavenger could be
STW at the same time). That code is just way too risky to change, hence
we keep the old behavior where _stwCollectionInProgress for global GC is
false while completeExternalConcurrentCycle is in progress, and set it
to true marginally later, just after completeExternalConcurrentCycle is
complete.

Signed-off-by: Aleksandar Micic amicic@ca.ibm.com

Generalize the existing flag that was being set only in Concurrent
Global GC to being maintained by base Collector, so that can be used
for any STW Collector.

Specifically, it was needed in an unusual combination when Concurrent
Scavenger was enabled, but Concurrent Mark disabled (so Global GC was
not MM_ConcurrentGC, but MM_ParallelGlobalGC which would not set STW
flag), and when CS would abort and Global Marking would miss to fixup
forwarded slots (during STW phase).

In future, the flag might be useful for other code in CS & Balanced to
determine if GC threads running in STW or concurrent phase. But for that
we have to properly set it for cases when Master Threads is explicit.
This is better to do in a separate change, if/when it becomes important.
For now, this flag is reliable only any STW GC with implicit Master
Thread.

This is a slightly adjusted variant of
eclipse-omr#5112 that had a problem with setting
this flag before completeExternalConcurrentCycle(). While in theory that
would be ok, heap resizing code in ConcurrentGC would (somewhat
incorrectly) rely on _stwCollectionInProgress being now true to conclude
that resizing request was not coming from overlapping Scavenger
(thinking that it's not possible that both Global and Scavenger could be
STW at the same time). That code is just way too risky to change, hence
we keep the old behavior where _stwCollectionInProgress for global GC is
false while completeExternalConcurrentCycle is in progress, and set it
to true marginally later, just after completeExternalConcurrentCycle is
complete.

Signed-off-by: Aleksandar Micic <amicic@ca.ibm.com>
@youngar
Copy link
Contributor

youngar commented Apr 28, 2020

@genie-omr build all

@youngar youngar merged commit e93965e into eclipse-omr:master Apr 28, 2020
@youngar youngar self-assigned this Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants