< 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,17 @@
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) {
+ if (ZGranuleSize % _block_size != 0) {
+ log_error(gc)("Filesystem block size of %s should be multiple of " SIZE_FORMAT,
+ AllocateHeapAt, _block_size);
+ return;
+ }
+ } else if (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;
}
< prev index next >