Path: blob/master/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.hpp
40971 views
/*1* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223#ifndef OS_LINUX_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_HPP24#define OS_LINUX_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_HPP2526class ZErrno;2728class ZPhysicalMemoryBacking {29private:30int _fd;31size_t _size;32uint64_t _filesystem;33size_t _block_size;34size_t _available;35bool _initialized;3637void warn_available_space(size_t max_capacity) const;38void warn_max_map_count(size_t max_capacity) const;3940int create_mem_fd(const char* name) const;41int create_file_fd(const char* name) const;42int create_fd(const char* name) const;4344bool is_tmpfs() const;45bool is_hugetlbfs() const;46bool tmpfs_supports_transparent_huge_pages() const;4748ZErrno fallocate_compat_mmap_hugetlbfs(size_t offset, size_t length, bool touch) const;49ZErrno fallocate_compat_mmap_tmpfs(size_t offset, size_t length) const;50ZErrno fallocate_compat_pwrite(size_t offset, size_t length) const;51ZErrno fallocate_fill_hole_compat(size_t offset, size_t length) const;52ZErrno fallocate_fill_hole_syscall(size_t offset, size_t length) const;53ZErrno fallocate_fill_hole(size_t offset, size_t length) const;54ZErrno fallocate_punch_hole(size_t offset, size_t length) const;55ZErrno split_and_fallocate(bool punch_hole, size_t offset, size_t length) const;56ZErrno fallocate(bool punch_hole, size_t offset, size_t length) const;5758bool commit_inner(size_t offset, size_t length) const;59size_t commit_numa_interleaved(size_t offset, size_t length) const;60size_t commit_default(size_t offset, size_t length) const;6162public:63ZPhysicalMemoryBacking(size_t max_capacity);6465bool is_initialized() const;6667void warn_commit_limits(size_t max_capacity) const;6869size_t commit(size_t offset, size_t length) const;70size_t uncommit(size_t offset, size_t length) const;7172void map(uintptr_t addr, size_t size, uintptr_t offset) const;73void unmap(uintptr_t addr, size_t size) const;74};7576#endif // OS_LINUX_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_HPP777879