< prev index next >

src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp

Print this page

        

@@ -136,18 +136,18 @@
   _filesystem = buf.f_type;
   _block_size = buf.f_bsize;
   _available = buf.f_bavail * _block_size;
 
   // Make sure we're on a supported filesystem
-  if (!is_tmpfs() && !is_hugetlbfs()) {
+  if (!ZAllowHeapOnFileSystem && !is_tmpfs() && !is_hugetlbfs()) {
     log_error(gc)("Backing file must be located on a %s or a %s filesystem",
                   ZFILESYSTEM_TMPFS, ZFILESYSTEM_HUGETLBFS);
     return;
   }
 
   // Make sure the filesystem type matches requested large page type
-  if (ZLargePages::is_transparent() && !is_tmpfs()) {
+  if (!ZAllowHeapOnFileSystem && ZLargePages::is_transparent() && !is_tmpfs()) {
     log_error(gc)("-XX:+UseTransparentHugePages can only be enable when using a %s filesystem",
                   ZFILESYSTEM_TMPFS);
     return;
   }
 

@@ -168,11 +168,11 @@
                   ZFILESYSTEM_HUGETLBFS);
     return;
   }
 
   const size_t expected_block_size = is_tmpfs() ? os::vm_page_size() : os::large_page_size();
-  if (expected_block_size != _block_size) {
+  if (!ZAllowHeapOnFileSystem && (expected_block_size != _block_size)) {
     log_error(gc)("%s filesystem has unexpected block size " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
                   is_tmpfs() ? ZFILESYSTEM_TMPFS : ZFILESYSTEM_HUGETLBFS, _block_size, expected_block_size);
     return;
   }
 

@@ -199,10 +199,15 @@
 
   return fd;
 }
 
 int ZPhysicalMemoryBacking::create_file_fd(const char* name) const {
+  if (ZAllowHeapOnFileSystem && (AllocateHeapAt == NULL)) {
+    log_error(gc)("-XX:AllocateHeapAt is needed when ZAllowHeapOnFileSystem is specified");
+    return -1;
+  }
+
   const char* const filesystem = ZLargePages::is_explicit()
                                  ? ZFILESYSTEM_HUGETLBFS
                                  : ZFILESYSTEM_TMPFS;
   const char** const preferred_mountpoints = ZLargePages::is_explicit()
                                              ? z_preferred_hugetlbfs_mountpoints
< prev index next >