-
Notifications
You must be signed in to change notification settings - Fork 721
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
Enable per-connection JITServer AOT cache disabling #19133
Enable per-connection JITServer AOT cache disabling #19133
Conversation
5273be6
to
de8cd28
Compare
Attn @mpirvu. Unfortunately, while I do reset the two This behaviour does seem to be present even when using a local SCC, though (that is, with All that being said, these changes do fix the crash I mentioned in the comment above. It's just that resetting the two flags doesn't seem to do anything at the moment. |
I said above that "the client never requests any AOT cache loads or stores", but I don't think I know that, actually. I'll add a log message to see whether or not the client requests any such compilations during the second connection. |
A correction - with |
I understand now. This block: // This is a connection to a new server after a previous disconnection
if ((0 != previousUID) && (previousUID != serverUID))
{
// Reset AOT deserializer (cached serialization records are now invalid)
auto deserializer = compInfo->getJITServerAOTDeserializer();
if (deserializer)
deserializer->reset(compInfoPT);
// Do not forbid AOT cache stores or loads (this server might be able to fulfill them)
compInfo->getPersistentInfo()->setDoNotRequestJITServerAOTCacheLoad(false);
compInfo->getPersistentInfo()->setDoNotRequestJITServerAOTCacheStore(false);
} is not being run, I think because here: openj9/runtime/compiler/control/JITServerHelpers.cpp Lines 1317 to 1322 in e5d99e1
we set the the server UID to zero. If this That also means we're not currently clearing the deserializer, because the current code assumes that the server UID being zero implies that the new connection is the first connection. |
Okay, I've added a flag that tracks if the client has ever connected to a server. That seems to fix the issue above, and fixes the deserializer reset problem 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.
Just a small suggestion. Looks good otherwise
46b0284
to
7a7f249
Compare
jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk17 |
Build failures unrelated to his PR:
@cjjdespres could you please rebase, maybe these errors have been fixed. |
If a JITServer client uses -XX:+JITServerAOTCacheIgnoreLocalSCC, servers that client connects to will now 1. Fail a compilation completely if the client requests an AOT cache store and the server cannot set up the compilation as an AOT cache store or load, and 2. Report the state of the server's AOT cache if (1) occurs, so the client will not continue to send AOT cache requests to that server if those requests could not possibly be fulfilled. The client tracks the state of the current server's AOT cache with the persistent info properties doNotRequestJITServerAOTCacheStore() and doNotRequestJITServerAOTCacheLoad(). Since a particular server's cache will never become able to complete AOT cache loads or stores partway through a connection (e.g., the server's cache never shrinks in size, so AOT cache stores will never succeed once it is full) these properties remain true once set for the duration of the connection with a particular server. They are reset whenever a client connects to a new server. Signed-off-by: Christian Despres <despresc@ibm.com>
The new _hasConnectedToServer flag in the persistent info is true at a JITServer client when it has previously connected to a server, regardless of the current status of any server connection. Tracking this property is necessary to ensure that the deserializer is reset on new connections, as the previous method (checking if the serverUID is 0) is not reliable for that purpose. This fixes a bug that prevented the deserializer from being reset when a client connected to a new server. Signed-off-by: Christian Despres <despresc@ibm.com>
Signed-off-by: Christian Despres <despresc@ibm.com>
7a7f249
to
698b8c5
Compare
Rebased. |
jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk17 |
If a JITServer client uses
-XX:+JITServerAOTCacheIgnoreLocalSCC
, servers that client connects to will nowFail a compilation completely if the client requests an AOT cache store and the server cannot set up the compilation as an AOT cache store or load, and
Report the state of the server's AOT cache if (1) occurs, so the client will not continue to send AOT cache requests to that server if those requests could not possibly be fulfilled.
The client tracks the state of the current server's AOT cache with the persistent info properties
doNotRequestJITServerAOTCacheStore()
anddoNotRequestJITServerAOTCacheLoad()
. Since a particular server's cache will never become able to complete AOT cache loads or stores partway through a connection (e.g., the server's cache never shrinks in size, so AOT cache stores will never succeed once it is full) these properties remain true once set for the duration of the connection with a particular server. They are reset whenever a client connects to a new server.These changes are necessary to prevent a crash at the client from occurring if the client is running with
-XX:+JITServerUseAOTCache -XX:+JITServerAOTCacheIgnoreLocalSCC
and connects to a server that is not running-XX:+JITServerUseAOTCache
(or, more generally, has an AOT cache in which methods or records cannot be stored).This PR also fixes a bug that prevented the deserializer from being reset when a client connected to a new server after a previous disconnection.
Related: #18990