diff options
author | Benety Goh <benety@mongodb.com> | 2020-12-09 08:05:47 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-12-09 13:33:44 +0000 |
commit | 51e3e36ac48cac80c920e5e418013fdb0a6747f2 (patch) | |
tree | 3232598c83a3004ad68ddf3891a865ccc196505e | |
parent | 588084f90b7b5706a4ec60db05826b3f30c1fc8e (diff) | |
download | mongo-51e3e36ac48cac80c920e5e418013fdb0a6747f2.tar.gz |
SERVER-53279 remove ProcessInfo::blockInMemory()
-rw-r--r-- | src/mongo/util/processinfo.h | 2 | ||||
-rw-r--r-- | src/mongo/util/processinfo_freebsd.cpp | 11 | ||||
-rw-r--r-- | src/mongo/util/processinfo_linux.cpp | 10 | ||||
-rw-r--r-- | src/mongo/util/processinfo_openbsd.cpp | 11 | ||||
-rw-r--r-- | src/mongo/util/processinfo_osx.cpp | 11 | ||||
-rw-r--r-- | src/mongo/util/processinfo_solaris.cpp | 12 | ||||
-rw-r--r-- | src/mongo/util/processinfo_unknown.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_windows.cpp | 28 |
8 files changed, 0 insertions, 89 deletions
diff --git a/src/mongo/util/processinfo.h b/src/mongo/util/processinfo.h index 12750da0f15..bddc4997dd5 100644 --- a/src/mongo/util/processinfo.h +++ b/src/mongo/util/processinfo.h @@ -164,8 +164,6 @@ public: static bool blockCheckSupported(); - static bool blockInMemory(const void* start); - /** * @return a pointer aligned to the start of the page the provided pointer belongs to. * diff --git a/src/mongo/util/processinfo_freebsd.cpp b/src/mongo/util/processinfo_freebsd.cpp index 3509fdd21f5..a935c485b43 100644 --- a/src/mongo/util/processinfo_freebsd.cpp +++ b/src/mongo/util/processinfo_freebsd.cpp @@ -177,17 +177,6 @@ bool ProcessInfo::blockCheckSupported() { return true; } -bool ProcessInfo::blockInMemory(const void* start) { - char x = 0; - if (mincore(alignToStartOfPage(start), getPageSize(), &x)) { - LOGV2(23336, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return 1; - } - return x & 0x1; -} - // 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 2ddd4c86da8..f4a8ac44ead 100644 --- a/src/mongo/util/processinfo_linux.cpp +++ b/src/mongo/util/processinfo_linux.cpp @@ -742,14 +742,4 @@ bool ProcessInfo::blockCheckSupported() { return true; } -bool ProcessInfo::blockInMemory(const void* start) { - unsigned char x = 0; - if (mincore(const_cast<void*>(alignToStartOfPage(start)), getPageSize(), &x)) { - auto e = errno; - LOGV2(23341, "mincore failed", "error"_attr = errnoWithDescription(e)); - return 1; - } - return x & 0x1; -} - } // namespace mongo diff --git a/src/mongo/util/processinfo_openbsd.cpp b/src/mongo/util/processinfo_openbsd.cpp index ba2c795ee1c..38b413ca91f 100644 --- a/src/mongo/util/processinfo_openbsd.cpp +++ b/src/mongo/util/processinfo_openbsd.cpp @@ -194,17 +194,6 @@ bool ProcessInfo::blockCheckSupported() { return true; } -bool ProcessInfo::blockInMemory(const void* start) { - char x = 0; - if (mincore((void*)alignToStartOfPage(start), getPageSize(), &x)) { - LOGV2(23349, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return 1; - } - return x & 0x1; -} - // 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 50d8931fc0f..6ff9fa2509c 100644 --- a/src/mongo/util/processinfo_osx.cpp +++ b/src/mongo/util/processinfo_osx.cpp @@ -220,15 +220,4 @@ bool ProcessInfo::blockCheckSupported() { return true; } -bool ProcessInfo::blockInMemory(const void* start) { - char x = 0; - if (mincore(alignToStartOfPage(start), getPageSize(), &x)) { - LOGV2(23354, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return 1; - } - return x & 0x1; -} - } // namespace mongo diff --git a/src/mongo/util/processinfo_solaris.cpp b/src/mongo/util/processinfo_solaris.cpp index f267b934c68..6df2af5b13f 100644 --- a/src/mongo/util/processinfo_solaris.cpp +++ b/src/mongo/util/processinfo_solaris.cpp @@ -227,16 +227,4 @@ bool ProcessInfo::blockCheckSupported() { return true; } -bool ProcessInfo::blockInMemory(const void* start) { - char x = 0; - if (mincore( - static_cast<char*>(const_cast<void*>(alignToStartOfPage(start))), getPageSize(), &x)) { - LOGV2(23358, - "mincore failed: {errnoWithDescription}", - "errnoWithDescription"_attr = errnoWithDescription()); - return 1; - } - return x & 0x1; -} - } // namespace mongo diff --git a/src/mongo/util/processinfo_unknown.cpp b/src/mongo/util/processinfo_unknown.cpp index 0d25d1d09ec..e5eebf5a4c3 100644 --- a/src/mongo/util/processinfo_unknown.cpp +++ b/src/mongo/util/processinfo_unknown.cpp @@ -63,10 +63,6 @@ void ProcessInfo::SystemInfo::collectSystemInfo() {} void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {} -bool ProcessInfo::blockInMemory(const void* start) { - 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 9fd82921e27..ba9608418aa 100644 --- a/src/mongo/util/processinfo_windows.cpp +++ b/src/mongo/util/processinfo_windows.cpp @@ -342,32 +342,4 @@ bool ProcessInfo::blockCheckSupported() { return true; } -bool ProcessInfo::blockInMemory(const void* start) { -#if 0 - // code for printing out page fault addresses and pc's -- - // this could be useful for targetting heavy pagefault locations in the code - static BOOL bstat = InitializeProcessForWsWatch( GetCurrentProcess() ); - PSAPI_WS_WATCH_INFORMATION_EX wiex[30]; - DWORD bufsize = sizeof(wiex); - bstat = GetWsChangesEx( GetCurrentProcess(), &wiex[0], &bufsize ); - if (bstat) { - for (int i=0; i<30; i++) { - if (wiex[i].BasicInfo.FaultingPc == 0) break; - LOGV2(677707, - "Encountered a page fault", - "faulting_pc"_attr = wiex[i].BasicInfo.FaultingPcm, - "address"_attr = wiex[i].BasicInfo.FaultingVa, - "thread_id"_attr = wiex[i].FaultingThreadId); - } - } -#endif - PSAPI_WORKING_SET_EX_INFORMATION wsinfo; - wsinfo.VirtualAddress = const_cast<void*>(start); - BOOL result = QueryWorkingSetEx(GetCurrentProcess(), &wsinfo, sizeof(wsinfo)); - if (result) - if (wsinfo.VirtualAttributes.Valid) - return true; - return false; -} - } // namespace mongo |