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

Ensure deserializer class invalidation is complete #20068

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

cjjdespres
Copy link
Contributor

When a class is redefined, the old, invalidated RAM methods may be held in the "oldClass" or the "newClass", depending on whether or not the class was redefined in-place. To ensure that all the old RAM methods from the redefined class are purged from the JITServer AOT deserializer's caches, and to avoid having to detect the type of redefinition, both the old and new classes are now invalidated.

The incomplete invalidation of classes is not currently a problem, as the only place the deserializer's method cache is queried for a stored RAM method during relocation happens to be reachable only if the defining class has not been invalidated. This change avoids a possible bug that would arise if this were ever not the case.

When a class is redefined, the old, invalidated RAM methods may be held
in the "oldClass" or the "newClass", depending on whether or not the
class was redefined in-place. To ensure that all the old RAM methods
from the redefined class are purged from the JITServer AOT
deserializer's caches, and to avoid having to detect the type of
redefinition, both the old and new classes are now invalidated.

The incomplete invalidation of classes is not currently a problem, as
the only place the deserializer's method cache is queried for a stored
RAM method during relocation happens to be reachable only if the
defining class has not been invalidated. This change avoids a possible
bug that would arise if this were ever not the case.

Signed-off-by: Christian Despres <despresc@ibm.com>
@cjjdespres
Copy link
Contributor Author

cjjdespres commented Aug 28, 2024

Attn @mpirvu. I haven't actually been able to observe this code run - I've run various test suites and have never seen a RAM method be invalidated in the deserializer cache. I have seen some RAM classes invalidated in sanity.openjdk, at least. extended.functional, at least. (EDIT: misremembered the test suite).

Actually, I've looked at the AOT cache code again, and I think that a method serialization record will end up only ever being created for a MethodFromClassAndSigRecord, which is an SVM record. (That's because only the TR_ValidateMethodFromClassAndSig relocation type causes a method serialization record to be created). Maybe I'll see some invalidations if I run with TR_DontDisableSVMDuringStartup .

@mpirvu mpirvu self-assigned this Aug 28, 2024
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Aug 28, 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 Aug 28, 2024

jenkins test sanity,extended,sanity.system,extended.system zlinuxjit,xlinuxjit jdk21

@mpirvu
Copy link
Contributor

mpirvu commented Aug 29, 2024

extended.functional on x86 failed due to infra:

15:48:00  fatal: unable to access 'https://github.com/eclipse-openj9/openj9.git/': Failed to connect to github.com port 443: Connection refused

Everything else passed, so I am going to merge.

@mpirvu mpirvu merged commit 6d7939e into eclipse-openj9:master Aug 29, 2024
11 of 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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants