diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 67d4778dbac..0892374ec50 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -6247,7 +6247,7 @@ void VM_Crac::doit() { int shmid = 0; int ret = checkpoint_restore(&shmid); if (ret == JVM_CHECKPOINT_ERROR) { - PerfMemoryLinux::checkpoint_fail(); + PerfMemoryLinux::restore(); return; } diff --git a/src/hotspot/os/linux/perfMemory_linux.hpp b/src/hotspot/os/linux/perfMemory_linux.hpp index 204fc56b4cd..07a3f611b57 100644 --- a/src/hotspot/os/linux/perfMemory_linux.hpp +++ b/src/hotspot/os/linux/perfMemory_linux.hpp @@ -35,9 +35,7 @@ class PerfMemoryLinux : AllStatic { } static bool checkpoint(const char* checkpoint_path); - static bool checkpoint_fail(); static bool restore(); }; #endif // OS_LINUX_PERFMEMORY_LINUX_HPP - diff --git a/src/hotspot/os/posix/perfMemory_posix.cpp b/src/hotspot/os/posix/perfMemory_posix.cpp index 3a4838be367..01e31ed3fae 100644 --- a/src/hotspot/os/posix/perfMemory_posix.cpp +++ b/src/hotspot/os/posix/perfMemory_posix.cpp @@ -1373,29 +1373,6 @@ bool PerfMemoryLinux::checkpoint(const char* checkpoint_path) { return true; } -bool PerfMemoryLinux::checkpoint_fail() { - if (checkpoint_fd < 0) { - return true; - } - - int fd; - RESTARTABLE(::open(backing_store_file_name, O_RDWR|O_CREAT|O_NOFOLLOW, S_IRUSR|S_IWUSR), fd); - if (fd == OS_ERR) { - tty->print_cr("cannot open original perfdata file: %s", os::strerror(errno)); - return false; - } - - void* mmapret = ::mmap(PerfMemory::start(), PerfMemory::capacity(), - PROT_READ|PROT_WRITE, MAP_FIXED|MAP_SHARED, fd, 0); - if (MAP_FAILED == mmapret) { - tty->print_cr("cannot mmap old perfdata file: %s", os::strerror(errno)); - ::close(fd); - return false; - } - - return true; -} - bool PerfMemoryLinux::restore() { if (checkpoint_fd < 0) { return true;