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

CRIU j9time_nano_time skips the elapsed time between Checkpoint/Restore #15016

Merged
merged 1 commit into from
May 21, 2022

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented May 5, 2022

Added a field checkpointRestoreTimeDelta within J9PortLibrary, which is to be set the time delta between Checkpoint and Restore of j9time_nano_time() return values;
Updated trace points to record the actual j9time_nano_time() values.

This is first part to address the issue #14211, for System.nanoTime().

Tested w/ following code snippet:

long beforeSnapshot = System.nanoTime();
System.out.println("System.nanoTime() before snapshot: " + beforeSnapshot);
criuSupport.checkpointJVM();
long afterRestore = System.nanoTime();
System.out.println("System.nanoTime() after restore: " + afterRestore + ", the delta is: " + (afterRestore - beforeSnapshot));

Snapshot run w/ -Xtrace:print={j9criu}

System.nanoTime() before snapshot: 1923502764451872
20:46:59.339 0x1aa00          j9criu.7        - Before checkpoint criu_dump(), beforeSnapshot = 1923502857103461

Multiple restores

20:47:03.515 0x1aa00          j9criu.8        - After checkpoint criu_dump(), afterRestore = 1923507032477031, snapshotRestoreTimeDelta = 4175373570
System.nanoTime() after restore: 1923502933280333, the delta is: 168828461
20:47:16.307 0x1aa00          j9criu.8        - After checkpoint criu_dump(), afterRestore = 1923519824763404, snapshotRestoreTimeDelta = 16967659943
System.nanoTime() after restore: 1923502929966245, the delta is: 165514373
20:47:18.447 0x1aa00          j9criu.8        - After checkpoint criu_dump(), afterRestore = 1923521964335134, snapshotRestoreTimeDelta = 19107231673
System.nanoTime() after restore: 1923502946667346, the delta is: 182215474

Signed-off-by: Jason Feng fengj@ca.ibm.com

@JasonFengJ9 JasonFengJ9 added comp:vm criu Used to track CRIU snapshot related work labels May 5, 2022
@JasonFengJ9 JasonFengJ9 requested a review from tajila May 5, 2022 21:31
@JasonFengJ9 JasonFengJ9 changed the title CRIU j9time_nano_time skips the elapsed time between Snapshot/Restore CRIU j9time_nano_time skips the elapsed time between Checkpoint/Restore May 6, 2022
@tajila
Copy link
Contributor

tajila commented May 9, 2022

can you add test cases for this?

@JasonFengJ9 JasonFengJ9 force-pushed the timedelta branch 2 times, most recently from 066ee26 to 21a62ae Compare May 12, 2022 14:25
@JasonFengJ9
Copy link
Member Author

can you add test cases for this?

Added a test, will need a rebase after merging #14824.

@JasonFengJ9 JasonFengJ9 force-pushed the timedelta branch 2 times, most recently from 40855e1 to 765b17d Compare May 17, 2022 12:17
@JasonFengJ9
Copy link
Member Author

Resolved the merge conflict.
@tajila this is ready for another look.

runtime/criusupport/criusupport.cpp Outdated Show resolved Hide resolved
runtime/criusupport/j9criu.tdf Show resolved Hide resolved
runtime/oti/j9port_generated.h Outdated Show resolved Hide resolved
Added a field checkpointRestoreTimeDelta within J9PortLibrary, which is
to be set the time delta between Checkpoint and Restore of
j9time_nano_time() return values;
Updated trace points to record the actual j9time_nano_time() values;
Add a test to verify the elapsed time.


Signed-off-by: Jason Feng <fengj@ca.ibm.com>
@tajila
Copy link
Contributor

tajila commented May 20, 2022

Jenkins test sanity xlinuxcriu jdk11

@tajila
Copy link
Contributor

tajila commented May 20, 2022

Jenkins test sanity win jdk8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm 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