[crac] RFR: Correct System.nanotime() value after restore [v2]
Radim Vansa
duke at openjdk.org
Thu Mar 30 07:55:37 UTC 2023
On Tue, 28 Mar 2023 09:32:15 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:
>> It should, since both times are read after restore.
>
> restore_start_counter is indeed read on restore, in the process that execs into CREngine, so the value is not adjusted. The value then transfered to the restored VM via SHM [1] and then used for the difference between the javaTimeNanos() which is going to be adjusted. I'm worried the difference between not adjusted and adjusted value may lose sense.
>
> Could you extend the NanoTimeTest to demonstrate the `uptime_since_restore` cannot become negative or "too" big?
>
> [1] https://github.com/openjdk/crac/commit/9ed961106a255145274de777e151577863b013ea#diff-aeec57d804d56002f26a85359fc4ac8b48cfc249d57c656a30a63fc6bf3457adR6385
You were right, I've applied the correction. I also took the liberty of renaming `_restore_start_counter` (and friends) to `_restore_start_nanos` as the 'counter' meaning might be a bit misleading.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/53#discussion_r1152868423
More information about the crac-dev
mailing list