summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-12-08 15:31:02 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-12-09 01:44:54 +0000
commitdb52eb78400a8c59ab6404447026d54a3183802a (patch)
tree1ec4d89e4c0df5d3dd80eec410433dd101f2d564 /src/mongo
parent787c8c087f2c97d482cd215bf20fa8d72f8404da (diff)
downloadmongo-db52eb78400a8c59ab6404447026d54a3183802a.tar.gz
SERVER-53279 remove ProcessInfo::pagesInMemory()
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/util/processinfo.h10
-rw-r--r--src/mongo/util/processinfo_freebsd.cpp15
-rw-r--r--src/mongo/util/processinfo_linux.cpp14
-rw-r--r--src/mongo/util/processinfo_openbsd.cpp15
-rw-r--r--src/mongo/util/processinfo_osx.cpp13
-rw-r--r--src/mongo/util/processinfo_solaris.cpp15
-rw-r--r--src/mongo/util/processinfo_unknown.cpp4
-rw-r--r--src/mongo/util/processinfo_windows.cpp21
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