Skip to content

DDR Changes for Off-Heap - #20111

Merged
keithc-ca merged 1 commit into
eclipse-openj9:masterfrom
LinHu2016:off-heap-ddr-part
Sep 12, 2024
Merged

DDR Changes for Off-Heap#20111
keithc-ca merged 1 commit into
eclipse-openj9:masterfrom
LinHu2016:off-heap-ddr-part

Conversation

@LinHu2016

@LinHu2016 LinHu2016 commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

This change would not have any dependence on off-heap runtime changes,
and should handle old core file (before any off-heap changes introduced)
, intermediate core file (-XXgc:disableIndexableDualHeaderShape) and new
core file (-XXgc:enableVirtualLargeObjectHeap or
-XXgc:disableVirtualLargeObjectHeap) smoothly.

  • Use gcExtensions.isVirtualLargeObjectHeapEnabled for identifying
    if off heap is enabled or not.
  • Verify the DataAddr via hasCorrectDataAddrPointer() if
    isVirtualLargeObjectHeapEnabled.
  • Use javaVM.isIndexableDataAddrPresent for identifying if there is
    extra DataAddr field in the header of IndexableObject.
  • Output DataAddr after size for IndexableObject if
    isIndexableDataAddrPresent.
  • Handle new structures
    J9IndexableObjectWithDataAddressContiguous/Discontiguous
  • Use arrayletObjectModel->_arrayletRangeBase/
    _arrayletRangeTop to verify if the address in heap.

Signed-off-by: lhu linhu@ca.ibm.com

}
if (false == isCorrectDataAddrPointer) {

if (false == J9IndexableObjectHelper.hasCorrectDataAddrPointer(array)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to do false ==, just !


if (dataSizeInBytes.isZero()) {
VoidPointer discontiguousDataAddr = VoidPointer.cast(arrayPtr.addOffset(J9IndexableObjectHelper.discontiguousHeaderSize()));
hasCorrectDataAddrPointer = (dataAddr.isNull() || dataAddr.equals(discontiguousDataAddr));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could be more strict if enableVirtualLargeObjectHeap is true, so that we disallow null.
Null is only possible in interim builds that don't have offheap code or in new builds with offheap disabled.

@amicic amicic Sep 10, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, my comment was not correct. at least for interpreter, we will have it null.

@@ -1194,19 +1194,8 @@ private int checkJ9Object(J9ObjectPointer object, GCHeapRegionDescriptor regionD
if (J9BuildFlags.J9VM_ENV_DATA64 && isIndexableDataAddressFlagSet() && ObjectModel.isIndexable(object)) {
if (!_javaVM.isIndexableDataAddrPresent().isZero()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to check if offheap is enabled here, and proceed with per object check only if it's enabled

if it's disabled we don't really need to do any check against dataAddr (even random value is ok, even though, it might be set properly by interpreter or often, but not alway zeroed by JIT).


UDATA heapAddr = UDATA.cast(address);
UDATA heapBase = UDATA.cast(extensions.cardTable()._heapBase());
UDATA heapTop = UDATA.cast(extensions.cardTable()._heapAlloc());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not be fetching base/alloc from card table. probalby those fileds exist in ext.heap

dataAddr = null;
}
out.format(" U_64 DataAddr = %s, %n", (dataAddr == null)? "NULL" : dataAddr.getHexAddress());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move after the size printing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No space before %n; missing space before ?.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been addressed.

@LinHu2016
LinHu2016 force-pushed the off-heap-ddr-part branch 9 times, most recently from d82fdea to 47a96f2 Compare September 9, 2024 15:08
@keithc-ca
keithc-ca self-requested a review September 9, 2024 16:12
@LinHu2016
LinHu2016 force-pushed the off-heap-ddr-part branch 2 times, most recently from dce38d6 to 441b94e Compare September 9, 2024 20:05
@LinHu2016

Copy link
Copy Markdown
Contributor Author

Hi @keithc-ca Could you please review the changes, Thanks

Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/AuxFieldInfo29.dat
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/AuxFieldInfo29.dat Outdated
dataAddr = null;
}
out.format(" U_64 DataAddr = %s, %n", (dataAddr == null)? "NULL" : dataAddr.getHexAddress());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No space before %n; missing space before ?.

Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/CompatibilityConstants29.dat Outdated
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/gc/GCArrayletObjectModelBase.java Outdated
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/gc/GCArrayletObjectModel_V2.java Outdated
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/pointer/AbstractPointer.java Outdated
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/pointer/AbstractPointer.java Outdated

@keithc-ca keithc-ca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several of my previous review comments have not been addressed: please correct that.

Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/gc/GCArrayletObjectModel_V2.java Outdated
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/gc/GCArrayletObjectModelBase.java Outdated
Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/pointer/AbstractPointer.java Outdated
dataAddr = null;
}
out.format(" U_64 DataAddr = %s, %n", (dataAddr == null)? "NULL" : dataAddr.getHexAddress());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has not been addressed.

@keithc-ca

Copy link
Copy Markdown
Contributor

Please update the commit message and the description here to use the full names of the relevant options (e.g. refer to -XXgc:disableIndexableDualHeaderShape instead of XXgc:disableIndexableDualHeaderShape).

Comment thread debugtools/DDR_VM/src/com/ibm/j9ddr/AuxFieldInfo29.dat Outdated
@LinHu2016
LinHu2016 force-pushed the off-heap-ddr-part branch 2 times, most recently from 35025a6 to b8a96b4 Compare September 11, 2024 12:51
@LinHu2016
LinHu2016 requested a review from keithc-ca September 11, 2024 15:09

@keithc-ca keithc-ca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the commit message:

  • correct the spelling of "dependence"
  • start sentences with a capital
  • insert a space before parenthetical comments
  • avoid lines longer than 72 characters

@amicic

amicic commented Sep 12, 2024

Copy link
Copy Markdown
Contributor

Functionally, looks good. I'll approve, although expect that a couple of comments from @keithc-ca (like updating PR comment) to be addressed.

This change would not have any dependence on off-heap runtime changes,
and should handle old core file (before any off-heap changes introduced)
, intermediate core file (-XXgc:disableIndexableDualHeaderShape) and new
core file (-XXgc:enableVirtualLargeObjectHeap or
-XXgc:disableVirtualLargeObjectHeap) smoothly.

 - Use gcExtensions.isVirtualLargeObjectHeapEnabled for identifying
 if off heap is enabled or not.
 - Verify the DataAddr via hasCorrectDataAddrPointer() if
 isVirtualLargeObjectHeapEnabled.
 - Use javaVM.isIndexableDataAddrPresent for identifying if there is
 extra DataAddr field in the header of IndexableObject.
 - Output DataAddr after size for IndexableObject if
 isIndexableDataAddrPresent.
 - Handle new structures
 J9IndexableObjectWithDataAddressContiguous/Discontiguous
 - Use arrayletObjectModel->_arrayletRangeBase/
 _arrayletRangeTop to verify if the address in heap.

Signed-off-by: lhu <linhu@ca.ibm.com>
@keithc-ca

Copy link
Copy Markdown
Contributor

Jenkins test sanity,extended amac jdk21

@keithc-ca
keithc-ca merged commit a600d90 into eclipse-openj9:master Sep 12, 2024
@amicic amicic added the comp:gc label Mar 17, 2025
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.

4 participants