-
Notifications
You must be signed in to change notification settings - Fork 738
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
Modify SCC queries to take non-persistent parameters #18821
Modify SCC queries to take non-persistent parameters #18821
Conversation
Attn @mpirvu. The current draft only modifies a couple of queries related to ROM classes, but eventually I will need to modify the queries related to methods as well. |
The |
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.
LGTM
@dsouzai Since this involves a SharedCache API change, I would appreciate a review from you as well. Thanks |
There is another change that might make things easier for me: currently
and
In both cases the actual structure of the chain is used simply to get the number of entries in the chain, but that can be calculated using the Everywhere else, it seems as though we do one of the following with the class chain:
Ensuring that openj9/runtime/compiler/runtime/JITServerAOTSerializationRecords.hpp Lines 198 to 212 in 7bbeb0f
a pointer to which is nearly a openj9/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp Lines 142 to 152 in 7bbeb0f
The Instead, I think it would be cleaner to, for instance, have Is there any reason why the two-step approach is currently used that would forbid doing it in this new way? |
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.
LGTM.
While there is now a slight discrepancy wrt to the other methods that call isROMStructureInSharedCache
, it is likely that the others will also eventually be generalized to operate based on a nonpersistent pointer given that the goal is to have AOT without a local SCC. Additionally, the whole point of these APIs was to hide the complexity and implementation details of the transformation between a pointer and an offset, and furthermore, to abstract what an offset even means (no one should be manipulating offsets directly; they should always use this APIs).
Therefore, as long as the API maintains its purpose, namely a service to exchange between pointers and offsets (regardless of what either actually mean) in a consistent manner, it is fair to change specifics. This PR conforms to this constraint.
jenkins test sanity all jdk17 |
I do still need to modify the |
I can't think of why
Yeah better for that to be a separate PR. |
This failed on zLinux as before:
@cjjdespres Does you openj9 source include the changes from #18792 ? |
You're right, this is based on a commit before #18792 was merged. |
676c285
to
2abc8e7
Compare
jenkins test sanity all jdk17 |
It looks like the test failed on Z in the same way:
|
"java.lang.AssertionError: There are no deserialized methods at the client." is seen for aarch64 pliux and zlinux |
A 100x grinder here of the nightly build with the test modified by #18835 (I think that's what setting the openj9 repo and branch does) on ppc64le_linux did not result in any failures of this kind. The only failure was a timeout in shutting down the server in a different sub-component of |
Since the failures seen are not related to this PR, I am going to merge it. |
The high-level shared class cache interface currently supports a number of queries like
openj9/runtime/compiler/env/J9SharedCache.cpp
Line 716 in d15ef63
These queries (
offsetInSharedCacheFromROMMethod
is another) are sometimes used directly, and sometimes form the basis of other queries likeopenj9/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp
Line 155 in d15ef63
A typical use of these methods is this:
openj9/runtime/compiler/codegen/J9AheadOfTimeCompile.cpp
Lines 552 to 554 in d15ef63
Whenever we use these methods we always have something like a
TR_OpaqueClassBlock *
(ultimately aJ9Class *
- thatgetPersistentClassPointerFromClassPointer
immediately converts the opaque class block to aJ9Class
) orJ9Method *
on hand, that we then convert to persistent form (J9ROMClass
orJ9ROMMethod
) to pass to the existing queries. Currently this is fine, but in #18301 I will not be able to rely on a local SCC being present. Instead, when compiling at the server I will have to look up "offsets" (JITServer AOT cache record IDs) using only cached client data and the JITServer AOT cache. The queries supported by these caches all require more information than something like aJ9ROMClass
- they effectively need a fullJ9Class *
(orJ9Method *
).To support #18301, this PR changes these query functions to take non-persistent JVM entities (
TR_OpaqueClassBlock *
coming from aJ9Class *
, for instance, rather thanJ9ROMClass
). All we do now is convert them immediately to persistent form and look them up in the SCC, but in #18301 I will override this behaviour when we are compiling a method intended for the JITServer AOT cache, instead looking up the relevant information in the client session data or JITServer AOT cache using the extra information that these queries will now receive.I'd argue that these new functions have a certain symmetry with the existing
rememberClass(J9Class *clazz)
. That function takes a class and returns an offset to its persistent representation (J9ROMClass
) inside the local SCC. The new functions will ask the matching question, "What is the offset of the persistent representation of the given class?", instead of current "What is the offset of thisJ9ROMClass *
?".An example of the kind of lookup that's available at the server is:
openj9/runtime/compiler/runtime/JITClientSession.hpp
Line 475 in d15ef63
That lookup involves the data stored in the maps
openj9/runtime/compiler/runtime/JITClientSession.hpp
Line 504 in d15ef63
and
openj9/runtime/compiler/runtime/JITServerAOTCache.hpp
Line 600 in d15ef63
That
ClassKey
needs more than just aJ9ROMClass
as well:openj9/runtime/compiler/runtime/JITServerAOTCache.hpp
Line 517 in d15ef63
Technically speaking, I could add a new cache that lets me look up the relevant data using only, say, a
J9ROMClass *
, but that seems less desirable, for reasons I mentioned in #18301 (comment).Since this PR is motivated by #18301, it may change based on the ultimate requirements of that PR as I finish it. I will also need to modify #18301 to base it on this one, so this will need to be merged before #18301.