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

Provide JITServer implementation for CRIU specific FE queries (0.38.0) #17151

Merged

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Apr 11, 2023

Two frontend queries that are specific to CRIU, inSnapshotMode() and isSnapshotModeEnabled() need to be overridden with JITServer specific implementation that fetches the required information from the client.
Three new fields were added to the ClientSessionData.VMInfo struct which caches information per client:
bool _inSnapshotMode;
bool _isSnapshotModeEnabled;
bool _isNonPortableRestoreMode;
_isSnapshotModeEnabled and _isNonPortableRestoreMode can be cached from the very first response of the client, because they get set when the VM is initialized and never change their value.
_inSnapshotMode requires special handling: if the client runs in portable restore mode, then this field is always true. If the client runs in non-portable restore mode, then this field starts as true, but after a restore, it transitions to false and it stays false until the end of the JVM. While this field returns 'true', the server must always inquire the client about the value of this field. After it transitions to false, the server can cache its value and refrain from asking the client again. For this purpose, a new message type was introduced, VM_inSnapshotMode and the MINOR_NUMBER of JITServer has been incremented.

Issue: #17117

Two frontend queries that are specific to CRIU, `inSnapshotMode()`
and `isSnapshotModeEnabled()` need to be overridden with JITServer
specific implementation that fetches the required information from
the client.
Three new fields were added to the `ClientSessionData.VMInfo` struct
which caches information per client:
      bool _inSnapshotMode;
      bool _isSnapshotModeEnabled;
      bool _isNonPortableRestoreMode;
`_isSnapshotModeEnabled` and `_isNonPortableRestoreMode` can be cached
from the very first response of the client, because they get set when the
VM is initialized and never change their value.
`_inSnapshotMode` requires special handling: if the client runs in
portable restore mode, then this field is always true. If the client runs
in non-portable restore mode, then this field starts as true, but after a
restore, it transitions to false and it stays false until the end of the JVM.
While this field returns 'true', the server must always inquire the client
about the value of this field. After it transitions to `false`, the server
can cache its value and refrain from asking the client again.
For this purpose, a new message type was introduced, `VM_inSnapshotMode`
and the `MINOR_NUMBER` of JITServer has been incremented.

Issue: eclipse-openj9#17117

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu mpirvu added comp:jitserver Artifacts related to JIT-as-a-Service project criu Used to track CRIU snapshot related work labels Apr 11, 2023
@mpirvu
Copy link
Contributor Author

mpirvu commented Apr 11, 2023

This is a cherry-pick of #17130

The code that has changed is specific to JITServer and should not affect the stability of non-JITServer environments

@mpirvu
Copy link
Contributor Author

mpirvu commented Apr 11, 2023

@dsouzai Could you please port this change to 0.38.0 release? Thanks

FYI: @pshipton

Copy link
Contributor

@dsouzai dsouzai left a comment

Choose a reason for hiding this comment

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

Patch is identical to #17130

@dsouzai dsouzai merged commit c84dcaf into eclipse-openj9:v0.38.0-release Apr 11, 2023
@mpirvu mpirvu deleted the criu-jitserver-fe-fix branch April 11, 2023 15:14
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 criu Used to track CRIU snapshot related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants