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

Reduce the number of VM_isStable messages #21067

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Feb 4, 2025

The frontend query isStable(J9Class *fieldClass, int32_t cpIndex) determines if the field at given J9Class and cpIndex has the @stable annotation.
Before this commit, the JITServer implementation had to send a VM_isStable message to the client for every such query. This commit implements caching of the isStable values at JITServer. Caching is done with a hashtable per J9Class, where the key is the cpIndex we are interested in.
To further reduce the number of the hashtables that serve as a cache, the isStable() will answer false for any non-bootstrap class. The reason is that at the moment only bootstrap classs have the @stable annotation. This behavior can be disabled by defining the following environment variable:
TR_DontIgnoreStableAnnotationForUserClasses.
Another optimization regards the implementation of isArrayWithStableElements(cpIndex, owningMethod, comp). In here, we first check to see if we are dealing with an array (which is simpler) and only then call the isStable() query.

Depends on eclipse-omr/omr#7642

@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Feb 4, 2025
@mpirvu mpirvu requested a review from dsouzai as a code owner February 4, 2025 20:58
@mpirvu mpirvu force-pushed the jitserver_cpu_debug branch from 46411b1 to 28f6ed8 Compare February 4, 2025 21:35
@mpirvu mpirvu added the depends:omr Pull request is dependent on a corresponding change in OMR label Feb 4, 2025
@dsouzai
Copy link
Contributor

dsouzai commented Feb 5, 2025

jenkins test sanity.functional xlinux,xlinuxjit,plinuxjit,zlinuxjit jdk21 depends eclipse-omr/omr#7642

@dsouzai
Copy link
Contributor

dsouzai commented Feb 6, 2025

@mpirvu failing tests are mostly the testJITServer_ tests; they all look to be crashes. Not sure if those are known failures or not.

@mpirvu
Copy link
Contributor Author

mpirvu commented Feb 6, 2025

JITServer failures are tracked by this: #21066
ssl.3 library is now embedded in the JDK, but dlopen does not find it.

@dsouzai
Copy link
Contributor

dsouzai commented Feb 6, 2025

The only remaining unexplained failure is https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.functional_ppc64le_linux_jit_Personal_testList_1/9/; seems to have timed out but I don't know if this is also a known issue.

@dsouzai
Copy link
Contributor

dsouzai commented Feb 6, 2025

Regardless, still waiting for the OMR changes to propagate before this can be merged.

@mpirvu mpirvu force-pushed the jitserver_cpu_debug branch from 28f6ed8 to a683036 Compare February 10, 2025 15:56
The frontend query `isStable(J9Class *fieldClass, int32_t cpIndex)`
determines if the field at given J9Class and cpIndex has the
@stable annotation.
Before this commit, the JITServer implementation had to send a
VM_isStable message to the client for every such query.
This commit implements caching of the isStable values at JITServer.
Caching is done with a hashtable per J9Class, where the key is
the cpIndex we are interested in.
To further reduce the number of the hashtables that serve as a
cache, the `isStable()` will answer `false` for any non-bootstrap
class. The reason is that at the moment only bootstrap classs have
the @stable annotation. This behavior can be disabled by defining
the following environment variable:
`TR_DontIgnoreStableAnnotationForUserClasses`.
Another optimization regards the implementation of
`isArrayWithStableElements(cpIndex, owningMethod, comp)`. In here,
we first check to see if we are dealing with an array (which is
simpler) and only then call the isStable() query.

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu mpirvu force-pushed the jitserver_cpu_debug branch from a683036 to bf518c3 Compare February 10, 2025 15:58
@mpirvu
Copy link
Contributor Author

mpirvu commented Feb 10, 2025

jenkins test sanity.functional xlinux,xlinuxjit,plinuxjit,zlinuxjit,alinux64jit jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Feb 10, 2025

@dsouzai All tests have passed. This PR is ready to be merged.

@dsouzai dsouzai merged commit 9b037f7 into eclipse-openj9:master Feb 11, 2025
13 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 depends:omr Pull request is dependent on a corresponding change in OMR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants