< prev index next >

src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp

Print this page




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #ifndef OS_CPU_LINUX_X86_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_X86_HPP
  25 #define OS_CPU_LINUX_X86_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_X86_HPP
  26 
  27 #include "gc/z/zBackingFile_linux_x86.hpp"
  28 #include "gc/z/zMemory.hpp"
  29 
  30 class ZErrno;
  31 class ZPhysicalMemory;
  32 
  33 class ZPhysicalMemoryBacking {
  34 private:
  35   ZMemoryManager _manager;
  36   ZBackingFile   _file;





  37 
  38   void check_max_map_count(size_t max_capacity) const;
  39   void check_available_space_on_filesystem(size_t max_capacity) const;
  40   void map_failed(ZErrno err) const;
  41 
  42   void advise_view(uintptr_t addr, size_t size) const;
  43   void pretouch_view(uintptr_t addr, size_t size) const;
  44   void map_view(ZPhysicalMemory pmem, uintptr_t addr, bool pretouch) const;
  45   void unmap_view(ZPhysicalMemory pmem, uintptr_t addr) const;
  46 
  47 public:
  48   ZPhysicalMemoryBacking(size_t max_capacity);
  49 
  50   bool is_initialized() const;
  51 
  52   size_t try_expand(size_t old_capacity, size_t new_capacity);




  53 
  54   ZPhysicalMemory alloc(size_t size);
  55   void free(ZPhysicalMemory pmem);
  56 
  57   uintptr_t nmt_address(uintptr_t offset) const;
  58 
  59   void map(ZPhysicalMemory pmem, uintptr_t offset) const;
  60   void unmap(ZPhysicalMemory pmem, uintptr_t offset) const;
  61 
  62   void debug_map(ZPhysicalMemory pmem, uintptr_t offset) const;
  63   void debug_unmap(ZPhysicalMemory pmem, uintptr_t offset) const;
  64 };
  65 
  66 #endif // OS_CPU_LINUX_X86_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_X86_HPP


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #ifndef OS_CPU_LINUX_X86_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_X86_HPP
  25 #define OS_CPU_LINUX_X86_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_X86_HPP
  26 
  27 #include "gc/z/zBackingFile_linux_x86.hpp"
  28 #include "gc/z/zMemory.hpp"
  29 
  30 class ZErrno;
  31 class ZPhysicalMemory;
  32 
  33 class ZPhysicalMemoryBacking {
  34 private:

  35   ZBackingFile   _file;
  36   ZMemoryManager _committed;
  37   ZMemoryManager _uncommitted;
  38 
  39   void warn_available_space(size_t max) const;
  40   void warn_max_map_count(size_t max) const;
  41 


  42   void map_failed(ZErrno err) const;
  43 
  44   void advise_view(uintptr_t addr, size_t size, int advice) const;
  45   void pretouch_view(uintptr_t addr, size_t size) const;
  46   void map_view(const ZPhysicalMemory& pmem, uintptr_t addr, bool pretouch) const;
  47   void unmap_view(const ZPhysicalMemory& pmem, uintptr_t addr) const;
  48 
  49 public:


  50   bool is_initialized() const;
  51 
  52   void warn_commit_limits(size_t max) const;
  53   bool supports_uncommit();
  54 
  55   size_t commit(size_t size);
  56   size_t uncommit(size_t size);
  57 
  58   ZPhysicalMemory alloc(size_t size);
  59   void free(const ZPhysicalMemory& pmem);
  60 
  61   uintptr_t nmt_address(uintptr_t offset) const;
  62 
  63   void map(const ZPhysicalMemory& pmem, uintptr_t offset) const;
  64   void unmap(const ZPhysicalMemory& pmem, uintptr_t offset) const;
  65 
  66   void debug_map(const ZPhysicalMemory& pmem, uintptr_t offset) const;
  67   void debug_unmap(const ZPhysicalMemory& pmem, uintptr_t offset) const;
  68 };
  69 
  70 #endif // OS_CPU_LINUX_X86_GC_Z_ZPHYSICALMEMORYBACKING_LINUX_X86_HPP
< prev index next >