[crac] RFR: 8328344: [CRaC] Avoid error when running with -XX:+PerfDisableSharedMem [v2]

Radim Vansa rvansa at openjdk.org
Tue Mar 19 15:16:36 UTC 2024


On Tue, 19 Mar 2024 10:02:06 GMT, Volker Simonis <simonis at openjdk.org> wrote:

>> CRaC tries to unconditionally restore the hsperf file, even if the checkpointed JVM process was started with `-XX:+PerfDisableSharedMem`.
>> 
>> The fix is trivial: check for the existence of the hsperf file in `PerfMemoryLinux::restore()` just as we already do it in `PerfMemoryLinux::checkpoint()`.
>
> Volker Simonis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Added test for -XX:+/-PerfDisableSharedMem

test/jdk/jdk/crac/PerfMemoryRestoreTest.java line 69:

> 67:         while (!perfdata.toFile().exists()) {
> 68:             if (System.nanoTime() - start > TimeUnit.SECONDS.toNanos(10)) {
> 69:                 if (perfDisableSharedMem) {

The file won't ever appear, so this would busy loop for the whole 10 seconds, extending the testsuite. Could you avoid the loop completely, or in case of `perfDisableSharedMem == true` reduce the delay to, say, 100 ms?

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

PR Review Comment: https://git.openjdk.org/crac/pull/153#discussion_r1530589986


More information about the crac-dev mailing list