-
Notifications
You must be signed in to change notification settings - Fork 396
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
Heap Resize: Concurrent KO/Uninitialized Mark Map Bug fix #4716
Conversation
e03a819
to
a520aa2
Compare
- MarkMap init consolidated MarkMap init logic has been merged to resolve the timing hole outlined in eclipse-openj9/openj9#8020. MarkMap init is dependent on Concurrent State of the global collector, with the init logic split between `heapAddRange` and `heapReconfigured`, any changes in states between the two may leave expanded mark map uninited. Hence, the decision to init (`setMarkBitsInRange`) the mark map has been moved from `heapAddRange` to `heapReconfigured` which is where we determine if an update to the init table is required (`tuneToHeap`/`determineInitWork`). As a result, init is no longer affected by the change in Concurrent state and we eliminate the timing window. This guarantee that the MarkMap will be inited, either on the spot or afterwards by updating the init table. - Introduced HeapReconfigReason and reworked heapReconfigred API heapReconfigred now distinguishes different reasons for reconfiguration (Expand, contract, etc), this functionality is required for the Mark Map init changes, specifically for Gencon and it is used when Scavenger resizes tenure _(PhysicalSubArenaVirtualMemorySemiSpace)_ or global collecter preforms a resize _(PhysicalSubArenaVirtualMemoryFlat)_. At the time, this is new information is only consumed by Concurrent Global Collecter (ConcurrentGC.cpp), for policies making use of other collectors the HeapReconfigReason param defaults to `NONE`. The Reconfig reasons are dealt in the following ways by Concurrent Global Collector: - We should never end up in `heapReconfigured` with `RECONFIG_NONE` reason - `RECONFIG_CONTRACT` signifies that `heapRemoveRange` had taken place, in which case, we just need to update init table (`tuneToHeap`) when Concurrent is Off, otherwise just `adjustTraceTargets` - If `heapAddRange` takes place then `heapReconfigured` is called with `RECONFIG_EXPAND` and have have two different cases: 1) heapAddRange was successful (return true), heap reconfig should be provided with `lowAddress` & `highAddress` which will be used to init mark map 2) heapAddRange returns false, signifies a failed `heapAddRange`, address params are expected to be NULL, in which case mark map won't be inited but we'll still either `tuneToHeap` or `adjustTraceTarget`. Signed-off-by: Salman Rana <salman.rana@ibm.com>
Removed default arguments for heapReconfigured for:
The default arguments are unnecessary... they're only required for the Subspace as that's the high level caller which propagates to the Collector and memory space (which in turn propagates to heap) |
`heapReconfigured` API changes resulting from eclipse-omr/omr#4716 Signed-off-by: Salman Rana <salman.rana@ibm.com>
This looks good to me. @dmitripivkine please, have a look. |
I believe size of PR name in OMR still be limited to 50 characters (70 in OpenJ9). So this PR might require renaming - up to OMR reviewer |
`heapReconfigured` API changes resulting from eclipse-omr/omr#4716 Signed-off-by: Salman Rana <salman.rana@ibm.com>
@rwy0717 @youngar please have a look, ready to be reviewed/merged |
@genie-omr build all |
Follow-up changes to eclipse-omr#4716 to remove code required temporarily to not break dependency with heapReconfigure API changes. Signed-off-by: Salman Rana <salman.rana@ibm.com>
Follow-up changes to eclipse-omr#4716 to remove code required temporarily to not break dependency with heapReconfigure API changes. Signed-off-by: Salman Rana <salman.rana@ibm.com>
Fixes eclipse-openj9/openj9#8020
MarkMap init logic has been merged to resolve the timing hole outlined in eclipse-openj9/openj9#8020 (comment). MarkMap init is dependent on Concurrent State of the global collector, with the init logic split between
heapAddRange
andheapReconfigured
, any changes in states between the two may leave expanded mark map uninited. Hence, the decision to init (setMarkBitsInRange
) the mark map has been moved fromheapAddRange
toheapReconfigured
which is where we determine if an update to the init table is required (tuneToHeap
/determineInitWork
). As a result, init is no longer affected by the change in Concurrent state and we eliminate the timing window. This guarantees that the MarkMap will be inited, either on the spot or afterwards by updating the init table.HeapReconfigReason
and reworkedheapReconfigred
APIheapReconfigred now distinguishes different reasons for reconfiguration (Expand, contract, etc), this functionality is required for the Mark Map init changes, specifically for Gencon and it is used when Scavenger resizes tenure (PhysicalSubArenaVirtualMemorySemiSpace) or global collecter preforms a resize (PhysicalSubArenaVirtualMemoryFlat). At the time, this new information is only consumed by Concurrent Global Collecter (ConcurrentGC.cpp), for policies making use of other collectors, the HeapReconfigReason param defaults to
NONE
.The Reconfig reasons are dealt in the following ways by Concurrent Global Collector:
heapReconfigured
withRECONFIG_NONE
reasonRECONFIG_CONTRACT
signifies thatheapRemoveRange
had taken place, in which case, we just need to update init table (tuneToHeap
) when Concurrent is Off, otherwise justadjustTraceTargets
heapAddRange
takes place thenheapReconfigured
is called withRECONFIG_EXPAND
and have have two different cases:1) heapAddRange was successful (returns true), heap reconfig should be provided with
lowAddress
&highAddress
which will be used to init mark map2) heapAddRange returns false, signifies a failed
heapAddRange
, address params are expected to be NULL, in which case mark map won't be inited but we'll still eithertuneToHeap
oradjustTraceTarget
.Signed-off-by: Salman Rana salman.rana@ibm.com