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

Refuse to generate array class serialization records #19135

Merged

Conversation

cjjdespres
Copy link
Contributor

The JITServer AOT cache will now refuse to generate class records for array ROM classes. This is relevant for clients running with -XX:+JITServerAOTCacheIgnoreLocalSCC - with this option disabled, the fact that array classes cannot be persisted in the local SCC acts as an implicit barrier to their ROM classes ever reaching the AOT cache. Without that option, the AOT cache must explicitly check that the given ROM class is not an array ROM class.

In future, the AOT cache should be extended with support for array classes. For now, this change prevents excessive AOT cache deserialization failures from occurring at JITServer clients running with -XX:+JITServerAOTCacheIgnoreLocalSCC due to the nonsensical class records the cache previously generated for array classes.

Related: #18990

@cjjdespres cjjdespres requested a review from dsouzai as a code owner March 13, 2024 19:30
@cjjdespres
Copy link
Contributor Author

Attn @mpirvu.

The JITServer AOT cache will now refuse to generate class records for
array ROM classes. This is relevant for clients running with
-XX:+JITServerAOTCacheIgnoreLocalSCC - with this option disabled, the
fact that array classes cannot be persisted in the local SCC acts as
an implicit barrier to their ROM classes ever reaching the AOT cache.
Without that option, the AOT cache must explicitly check that the given
ROM class is not an array ROM class.

In future, the AOT cache should be extended with support for array
classes. For now, this change prevents excessive AOT cache
deserialization failures from occurring at JITServer clients running
with -XX:+JITServerAOTCacheIgnoreLocalSCC due to the nonsensical
class records the cache previously generated for array classes.

Signed-off-by: Christian Despres <despresc@ibm.com>
@cjjdespres cjjdespres force-pushed the disable-array-class-record-gen branch from d161420 to 8729348 Compare March 13, 2024 19:46
@cjjdespres
Copy link
Contributor Author

I did modify the log message that is emitted when the _definingClassChainRecord cannot be constructed for a method that is requested to be AOT cache compiled. That might be overkill; I think it might not be possible for an array class to appear in the class chain of the containing class of a method to be compiled. It's in rememberClass that we definitely can encounter them.

// The current implementation cannot handle array ROM classes - the name must be recorded
// properly and the hash of the class must incorporate the array ROM class, the arity of the array,
// and the element ROM class.
if (J9ROMCLASS_IS_ARRAY(romClass))
Copy link
Contributor

Choose a reason for hiding this comment

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

Excluding primitive array classes may be overkill. Their ROMClasses store their proper names which can be used to look them up at the client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was worried that the romClass might be from an array class with primitive element type and arity greater than 1. I think that would result in a romClass with a name that looks like [I or something, but wouldn't have any arity information. Is that an issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect (but you might want to check) that multidimensional primitive array classes still use the [L ROMClass since they are arrays of references. By primitive arrays I meant specifically 1D arrays like [I or [Z, they use properly named ROMClasses. They are not stored in the SCC though, so I guess excluding them here should result in the same behaviour as before with the underlying local SCC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'll leave it as-is just to keep the same behaviour as before when not ignoring the SCC.

@mpirvu mpirvu self-assigned this Mar 14, 2024
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Mar 14, 2024
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

LGTM

@mpirvu
Copy link
Contributor

mpirvu commented Mar 18, 2024

jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk17

@mpirvu
Copy link
Contributor

mpirvu commented Mar 19, 2024

On zlinux the tests passed, but then the harness couldn't cleanup.
Same thing on xlinux:
17:08:01 TOTAL: 200 EXECUTED: 199 PASSED: 199 FAILED: 0 DISABLED: 0 SKIPPED: 1
17:08:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17:08:01
17:08:01 ALL TESTS PASSED
17:08:01 pkill -9 -xf "/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_x86-64_linux_jit_Personal_testList_0/jdkbinary/j2sdk-image/bin/jitserver"; true
...
17:10:34 Woohoo - no rogue processes detected!
[Pipeline] cleanWs
17:10:35 [WS-CLEANUP] Deleting project workspace...
17:10:35 [WS-CLEANUP] Deferred wipeout is disabled by the job configuration...
17:10:38 ERROR: Cannot delete workspace :Unable to delete '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_x86-64_linux_jit_Personal_testList_0/aqa-tests/TKG/output_17107819325972/cmdLineTester_criu_nonPortableRestore_0/badDir/core-27094.img'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
[Pipeline] echo
17:10:38 Exception: hudson.AbortException: Cannot delete workspace: Unable to delete '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_x86-64_linux_jit_Personal_testList_0/aqa-tests/TKG/output_17107819325972/cmdLineTester_criu_nonPortableRestore_0/badDir/core-27094.img'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.

...

@mpirvu
Copy link
Contributor

mpirvu commented Mar 19, 2024

jenkins test sanity xlinuxjit,zlinuxjit jdk17

@mpirvu
Copy link
Contributor

mpirvu commented Mar 19, 2024

xlinux had the same infra issue:

03:53:09  TOTAL: 243   EXECUTED: 198   PASSED: 198   FAILED: 0   DISABLED: 8   SKIPPED: 37
03:53:09  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...
03:53:39  ERROR: Cannot delete workspace :Unable to delete '/home/jenkins/workspace/Test_openjdk17_j9_sanity.functional_x86-64_linux_jit_Personal_testList_1/aqa-tests/TKG/output_17108235367638/cmdLineTester_criu_nonPortableRestore_1/badDir/core-27684.img'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.

Since the tests themselves have passed am going to merge anyway.

@mpirvu mpirvu merged commit 417c02f into eclipse-openj9:master Mar 19, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants