Skip to content

Commit

Permalink
Fix bug in Linux current_process_memory_usage() where we weren't taki…
Browse files Browse the repository at this point in the history
…ng the fast path if private_committed wasn't being asked for.
  • Loading branch information
ned14 committed Aug 21, 2021
1 parent 2917dc7 commit 7edfef2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/llfio/v2.0/detail/impl/map_handle.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion include/llfio/v2.0/detail/impl/posix/map_handle.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion include/llfio/v2.0/detail/impl/posix/utils.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down

0 comments on commit 7edfef2

Please sign in to comment.