src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp
changeset 50979 270b11dadbaf
parent 50525 767cdb97f103
child 53244 9807daeb47c4
equal deleted inserted replaced
50978:a63f6915a1f9 50979:270b11dadbaf
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    35   ZMemoryManager _manager;
    35   ZMemoryManager _manager;
    36   ZBackingFile   _file;
    36   ZBackingFile   _file;
    37   const size_t   _granule_size;
    37   const size_t   _granule_size;
    38 
    38 
    39   void check_max_map_count(size_t max_capacity, size_t granule_size) const;
    39   void check_max_map_count(size_t max_capacity, size_t granule_size) const;
       
    40   void check_available_space_on_filesystem(size_t max_capacity) const;
    40   void map_failed(ZErrno err) const;
    41   void map_failed(ZErrno err) const;
    41 
    42 
    42   void advise_view(uintptr_t addr, size_t size) const;
    43   void advise_view(uintptr_t addr, size_t size) const;
    43   void pretouch_view(uintptr_t addr, size_t size) const;
    44   void pretouch_view(uintptr_t addr, size_t size) const;
    44   void map_view(ZPhysicalMemory pmem, uintptr_t addr, bool pretouch) const;
    45   void map_view(ZPhysicalMemory pmem, uintptr_t addr, bool pretouch) const;
    47 public:
    48 public:
    48   ZPhysicalMemoryBacking(size_t max_capacity, size_t granule_size);
    49   ZPhysicalMemoryBacking(size_t max_capacity, size_t granule_size);
    49 
    50 
    50   bool is_initialized() const;
    51   bool is_initialized() const;
    51 
    52 
    52   bool expand(size_t from, size_t to);
    53   size_t try_expand(size_t old_capacity, size_t new_capacity);
       
    54 
    53   ZPhysicalMemory alloc(size_t size);
    55   ZPhysicalMemory alloc(size_t size);
    54   void free(ZPhysicalMemory pmem);
    56   void free(ZPhysicalMemory pmem);
    55 
    57 
    56   uintptr_t nmt_address(uintptr_t offset) const;
    58   uintptr_t nmt_address(uintptr_t offset) const;
    57 
    59