diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2015-02-16 03:33:47 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2015-02-16 03:33:47 -0500 |
commit | e17328a227a47089e6f3c8fd82cc988f03807549 (patch) | |
tree | c78336b4caff2c1ab31180efdd4c8298c890aee6 /src/mem/physical.hh | |
parent | 57758ca685fe1a736cfdc214785b04441e83e53a (diff) | |
download | gem5-e17328a227a47089e6f3c8fd82cc988f03807549.tar.xz |
mem: mmap the backing store with MAP_NORESERVE
This patch ensures we can run simulations with very large simulated
memories (at least 64 TB based on some quick runs on a Linux
workstation). In essence this allows us to efficiently deal with
sparse address maps without having to implement a redirection layer in
the backing store.
This opens up for run-time errors if we eventually exhausts the hosts
memory and swap space, but this should hopefully never happen.
Diffstat (limited to 'src/mem/physical.hh')
-rw-r--r-- | src/mem/physical.hh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mem/physical.hh b/src/mem/physical.hh index b8d26fd4b..0f53b1d9d 100644 --- a/src/mem/physical.hh +++ b/src/mem/physical.hh @@ -85,6 +85,9 @@ class PhysicalMemory : public Serializable // The total memory size uint64_t size; + // Let the user choose if we reserve swap space when calling mmap + const bool mmapUsingNoReserve; + // The physical memory used to provide the memory in the simulated // system std::vector<std::pair<AddrRange, uint8_t*>> backingStore; @@ -112,7 +115,8 @@ class PhysicalMemory : public Serializable * Create a physical memory object, wrapping a number of memories. */ PhysicalMemory(const std::string& _name, - const std::vector<AbstractMemory*>& _memories); + const std::vector<AbstractMemory*>& _memories, + bool mmap_using_noreserve); /** * Unmap all the backing store we have used. |