diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2021-08-21 21:49:24 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2021-08-21 21:49:24 +0300 |
commit | 7edfef2c652dd0750a7b91c9582d3290394026d4 (patch) | |
tree | 1ff224fa4b685ccee85ed2cde782845c24770b16 | |
parent | 2917dc7799bc3be9c3fef406ccde21a273aeaffc (diff) |
Fix bug in Linux current_process_memory_usage() where we weren't taking the fast path if private_committed wasn't being asked for.
-rw-r--r-- | include/llfio/v2.0/detail/impl/map_handle.ipp | 3 | ||||
-rw-r--r-- | include/llfio/v2.0/detail/impl/posix/map_handle.ipp | 2 | ||||
-rw-r--r-- | include/llfio/v2.0/detail/impl/posix/utils.ipp | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/include/llfio/v2.0/detail/impl/map_handle.ipp b/include/llfio/v2.0/detail/impl/map_handle.ipp index e5e9fa94..d422f129 100644 --- a/include/llfio/v2.0/detail/impl/map_handle.ipp +++ b/include/llfio/v2.0/detail/impl/map_handle.ipp @@ -125,8 +125,9 @@ namespace detail if(-1 == ::munmap(p->addr, _bytes)) #endif { + std::cerr << "munmap failed with " << strerror(errno) << ". addr was " << p->addr << " bytes was " << _bytes << std::endl; LLFIO_LOG_FATAL(nullptr, - "map_handle cache failed to trim a map! If on Linux, you may have exceeded the " + "FATAL: map_handle cache failed to trim a map! If on Linux, you may have exceeded the " "64k VMA process limit, set the LLFIO_DEBUG_LINUX_MUNMAP macro at the top of posix/map_handle.ipp to cause dumping of VMAs to " "/tmp/llfio_unmap_debug_smaps.txt, and combine with strace to figure it out."); abort(); diff --git a/include/llfio/v2.0/detail/impl/posix/map_handle.ipp b/include/llfio/v2.0/detail/impl/posix/map_handle.ipp index bc6bf345..697dd8b6 100644 --- a/include/llfio/v2.0/detail/impl/posix/map_handle.ipp +++ b/include/llfio/v2.0/detail/impl/posix/map_handle.ipp @@ -157,7 +157,7 @@ map_handle::~map_handle() if(ret.has_error()) { LLFIO_LOG_FATAL(_v.fd, - "map_handle::~map_handle() close failed. Cause is typically other code modifying mapped regions. If on Linux, you may have exceeded the " + "FATAL: map_handle::~map_handle() close failed. Cause is typically other code modifying mapped regions. If on Linux, you may have exceeded the " "64k VMA process limit, set the LLFIO_DEBUG_LINUX_MUNMAP macro at the top of posix/map_handle.ipp to cause dumping of VMAs to " "/tmp/llfio_unmap_debug_smaps.txt, and combine with strace to figure it out."); abort(); diff --git a/include/llfio/v2.0/detail/impl/posix/utils.ipp b/include/llfio/v2.0/detail/impl/posix/utils.ipp index 2332ae91..c043ca44 100644 --- a/include/llfio/v2.0/detail/impl/posix/utils.ipp +++ b/include/llfio/v2.0/detail/impl/posix/utils.ipp @@ -341,7 +341,7 @@ namespace utils private_paged_in = ??? MISSING */ - if(want & process_memory_usage::want::private_committed_inaccurate) + if(!(want & process_memory_usage::want::private_committed) || (want & process_memory_usage::want::private_committed_inaccurate)) { process_memory_usage ret; if((want & process_memory_usage::want::total_address_space_in_use) || (want & process_memory_usage::want::total_address_space_paged_in) || |