-
Notifications
You must be signed in to change notification settings - Fork 767
Update CRC32C acceleration for off-heap #21852
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
Conversation
Marking this WIP while I launch a personal test build. |
launched personal build for verification. |
Do you mean CRC32C? |
ah, dang, missed the C. I'll update the commit |
3794477
to
5111063
Compare
This PR is ready, @Spencer-Comin , @r30shah Can I please get a review? |
if (TR::Compiler->om.isOffHeapAllocationEnabled()) | ||
{ | ||
// Load first data element address | ||
generateRXInstruction(cg, | ||
TR::InstOpCode::getLoadOpCode(), | ||
node, | ||
array, | ||
generateS390MemoryReference(array, cg->comp()->fej9()->getOffsetOfContiguousDataAddrField(), cg)); | ||
|
||
// Since the first data element address is retrieved from the array header, the offset is set to 0 | ||
offsetToDataElements = 0; | ||
} |
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.
Does this work for the updateDirectByteBuffer
as well?
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 have just updated the if condition. From what I understand directByteBuffer is supposed to be a contiguous memory off heap so we should be good using the passed in address without doing anything special in off-heap mode. @amicic Can you please confirm?
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.
Not expert, but yes DBB probably has an explicit pointer to the memory. DBB has nothing to do with Java Arrays, hence no dataAddr awareness (but I guess, onцe you reach the memory, you are free to apply some of array specific optimizations).
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.
Minor nitpick.
// Offset to be added to array object pointer to get to the data elements | ||
int32_t offsetToDataElements = isDirectBuffer ? 0 : TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); |
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.
// Offset to be added to array object pointer to get to the data elements | |
int32_t offsetToDataElements = isDirectBuffer ? 0 : TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); | |
// Offset to be added to array object pointer to get to the data elements | |
int32_t offsetToDataElements = isDirectBuffer ? 0 : static_cast<int32_t>(TR::Compiler->om.contiguousArrayHeaderSizeInBytes()); |
Jenkins test sanity zlinux jdk11,jdk21 |
@VermaSh Please wait for the tests to finish before you apply minor nitpick change |
Don't think the failure is related to my changes. It looks similar to the stack trace in other failures due to #21720
|
The acceleration was initially disabled because it added array header size to the array object, which was required to reach the elements. However, this is unnecessary for off-heap mode. As a result, the evaluator has been updated to add the array header size exclusively for non-off-heap mode, while in off-heap mode, it now retrieves the data element address directly from the array header, enabling acceleration in off-heap mode. Signed-off-by: Shubham Verma <[email protected]>
@r30shah I have updated the PR with your suggestion. |
jenkins test sanity zlinux jdk21 |
The acceleration was initially disabled because it added array header size to the array object, which was required to reach the elements. However, this is unnecessary for off-heap mode. As a result, the evaluator has been updated to add the array header size exclusively for non-off-heap mode, while in off-heap mode, it now retrieves the data element address directly from the array header, enabling acceleration in off-heap mode.