diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/util/processinfo.h | 10 | ||||
-rw-r--r-- | src/mongo/util/processinfo_freebsd.cpp | 15 | ||||
-rw-r--r-- | src/mongo/util/processinfo_linux.cpp | 14 | ||||
-rw-r--r-- | src/mongo/util/processinfo_openbsd.cpp | 15 | ||||
-rw-r--r-- | src/mongo/util/processinfo_osx.cpp | 13 | ||||
-rw-r--r-- | src/mongo/util/processinfo_solaris.cpp | 15 | ||||
-rw-r--r-- | src/mongo/util/processinfo_unknown.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_windows.cpp | 21 |
8 files changed, 0 insertions, 107 deletions
diff --git a/src/mongo/util/processinfo.h b/src/mongo/util/processinfo.h index 63f1515050d..12750da0f15 100644 --- a/src/mongo/util/processinfo.h +++ b/src/mongo/util/processinfo.h @@ -176,16 +176,6 @@ public: ~(getPageSize() - 1)); } - /** - * Sets i-th element of 'out' to non-zero if the i-th page starting from the one containing - * 'start' is in memory. - * The 'out' vector will be resized to fit the requested number of pages. - * @return true on success, false otherwise - * - * NOTE: requires blockCheckSupported() == true - */ - static bool pagesInMemory(const void* start, size_t numPages, std::vector<char>* out); - static const std::string& getProcessName() { return appInfo().getProcessName(); } diff --git a/src/mongo/util/processinfo_freebsd.cpp b/src/mongo/util/processinfo_freebsd.cpp index f47e13e2b92..3509fdd21f5 100644 --- a/src/mongo/util/processinfo_freebsd.cpp +++ b/src/mongo/util/processinfo_freebsd.cpp @@ -188,21 +188,6 @@ bool ProcessInfo::blockInMemory(const void* start) { return x & 0x1; } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - out->resize(numPages); - // int mincore(const void *addr, size_t len, char *vec); - if (mincore(alignToStartOfPage(start), numPages * getPageSize(), &(out->front()))) { - LOGV2(23337, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return false; - } - for (size_t i = 0; i < numPages; ++i) { - (*out)[i] = 0x1; - } - return true; -} - // get the number of CPUs available to the scheduler boost::optional<unsigned long> ProcessInfo::getNumCoresForProcess() { long nprocs = sysconf(_SC_NPROCESSORS_ONLN); diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp index 3e764d7a21e..2ddd4c86da8 100644 --- a/src/mongo/util/processinfo_linux.cpp +++ b/src/mongo/util/processinfo_linux.cpp @@ -752,18 +752,4 @@ bool ProcessInfo::blockInMemory(const void* start) { return x & 0x1; } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - out->resize(numPages); - if (mincore(const_cast<void*>(alignToStartOfPage(start)), - numPages * getPageSize(), - reinterpret_cast<unsigned char*>(&out->front()))) { - auto e = errno; - LOGV2(23342, "mincore failed", "error"_attr = errnoWithDescription(e)); - return false; - } - for (size_t i = 0; i < numPages; ++i) { - (*out)[i] &= 0x1; - } - return true; -} } // namespace mongo diff --git a/src/mongo/util/processinfo_openbsd.cpp b/src/mongo/util/processinfo_openbsd.cpp index 260acc84a20..ba2c795ee1c 100644 --- a/src/mongo/util/processinfo_openbsd.cpp +++ b/src/mongo/util/processinfo_openbsd.cpp @@ -205,21 +205,6 @@ bool ProcessInfo::blockInMemory(const void* start) { return x & 0x1; } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - out->resize(numPages); - // int mincore(const void *addr, size_t len, char *vec); - if (mincore((void*)alignToStartOfPage(start), numPages * getPageSize(), &(out->front()))) { - LOGV2(23350, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return false; - } - for (size_t i = 0; i < numPages; ++i) { - (*out)[i] = 0x1; - } - return true; -} - // get the number of CPUs available to the scheduler boost::optional<unsigned long> ProcessInfo::getNumCoresForProcess() { long nprocs = sysconf(_SC_NPROCESSORS_ONLN); diff --git a/src/mongo/util/processinfo_osx.cpp b/src/mongo/util/processinfo_osx.cpp index 4de98f203ca..50d8931fc0f 100644 --- a/src/mongo/util/processinfo_osx.cpp +++ b/src/mongo/util/processinfo_osx.cpp @@ -231,17 +231,4 @@ bool ProcessInfo::blockInMemory(const void* start) { return x & 0x1; } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - out->resize(numPages); - if (mincore(alignToStartOfPage(start), numPages * getPageSize(), &out->front())) { - LOGV2(23355, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return false; - } - for (size_t i = 0; i < numPages; ++i) { - (*out)[i] &= 0x1; - } - return true; -} } // namespace mongo diff --git a/src/mongo/util/processinfo_solaris.cpp b/src/mongo/util/processinfo_solaris.cpp index 61e509a1089..f267b934c68 100644 --- a/src/mongo/util/processinfo_solaris.cpp +++ b/src/mongo/util/processinfo_solaris.cpp @@ -239,19 +239,4 @@ bool ProcessInfo::blockInMemory(const void* start) { return x & 0x1; } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - out->resize(numPages); - if (mincore(static_cast<char*>(const_cast<void*>(alignToStartOfPage(start))), - numPages * getPageSize(), - &out->front())) { - LOGV2(23359, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return false; - } - for (size_t i = 0; i < numPages; ++i) { - (*out)[i] &= 0x1; - } - return true; -} } // namespace mongo diff --git a/src/mongo/util/processinfo_unknown.cpp b/src/mongo/util/processinfo_unknown.cpp index b77e79d8fae..0d25d1d09ec 100644 --- a/src/mongo/util/processinfo_unknown.cpp +++ b/src/mongo/util/processinfo_unknown.cpp @@ -67,10 +67,6 @@ bool ProcessInfo::blockInMemory(const void* start) { verify(0); } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - verify(0); -} - boost::optional<unsigned long> ProcessInfo::getNumCoresForProcess() { return boost::none; } diff --git a/src/mongo/util/processinfo_windows.cpp b/src/mongo/util/processinfo_windows.cpp index 61c72aceca9..9fd82921e27 100644 --- a/src/mongo/util/processinfo_windows.cpp +++ b/src/mongo/util/processinfo_windows.cpp @@ -370,25 +370,4 @@ bool ProcessInfo::blockInMemory(const void* start) { return false; } -bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, std::vector<char>* out) { - out->resize(numPages); - std::unique_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> wsinfo( - new PSAPI_WORKING_SET_EX_INFORMATION[numPages]); - - const void* startOfFirstPage = alignToStartOfPage(start); - for (size_t i = 0; i < numPages; i++) { - wsinfo[i].VirtualAddress = reinterpret_cast<void*>( - reinterpret_cast<unsigned long long>(startOfFirstPage) + i * getPageSize()); - } - - BOOL result = QueryWorkingSetEx( - GetCurrentProcess(), wsinfo.get(), sizeof(PSAPI_WORKING_SET_EX_INFORMATION) * numPages); - - if (!result) - return false; - for (size_t i = 0; i < numPages; ++i) { - (*out)[i] = wsinfo[i].VirtualAttributes.Valid ? 1 : 0; - } - return true; -} } // namespace mongo |