[crac] RFR: Correct System.nanotime() value after restore [v2]

Radim Vansa rvansa at openjdk.org
Fri Jun 16 14:01:34 UTC 2023


On Thu, 13 Apr 2023 15:45:50 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> @AntonKozlov 
>> 
>>> Crac-criu does not use restore timens [1] since once a bug in kernel or criu caused timedwait to return immediatelly everytime that is called after restore. I don't remember the bug exactly (already fixed), but I believe it was discussed on this maillist
>> 
>> https://github.com/CRaC/criu/commit/1cb2f4a518a4ae471a1df7a9b540203c1efaf1ba commit is dated July 14, 2020, but the crac-dev archives has earliest mailing list from Sept 2021. Is there some other mailing list this was discussed on? I am interested in understanding the problem that prompted not to use timens in criu.
>> Since you mention it was a bug in kernel or criu and it has been almost 3 years since your commit, may be it is worth enabling the criu changes again to see if the timedwait problem still exists, unless you have already done that.
>> 
>>> In general, we should not to depend on very obscure linux abillities, as this reduce chances we'd be able to run on something rather than linux.
>> 
>> I don't think timens can be put in the category of obscure linux ability. It has even made its way into container runtime spec: https://github.com/opencontainers/runtime-spec/pull/1151.
>
>> Since you mention it was a bug in kernel or criu and it has been almost 3 years since your commit, may be it is worth enabling the criu changes again to see if the timedwait problem still exists, unless you have already done that.
> 
> AFAIK the bug is fixed, but I see no point of relying on OS here. Is there one? Timens that is not changed by CRIU provides correct values for our nanoTime() [1].
> 
>> The value returned represents nanoseconds since some fixed but arbitrary origin time (perhaps in the future, so values may be negative). The same origin is used by all invocations of this method in an instance of a Java virtual machine
> 
> [1] https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/System.html#nanoTime()

Hi @AntonKozlov was this only off your radar or is there anything that still needs consideration?

-------------

PR Comment: https://git.openjdk.org/crac/pull/53#issuecomment-1594721393


More information about the crac-dev mailing list