summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.ibm.com>2018-11-09 14:38:22 +1100
committerAnel Husakovic <anel@mariadb.org>2020-02-20 08:44:20 +0100
commitfb01cc3766be9131402b82730adfa0e45e6e3511 (patch)
treef3ef6f22014af71162a0579940f782113f6a307f /cmake
parent959fc0c0ccaac0c0946a9c07bceb9b82116c8b47 (diff)
downloadmariadb-git-fb01cc3766be9131402b82730adfa0e45e6e3511.tar.gz
my_getncpus based on threads available
Detecting the cpus based on sysconf of the online CPUs can significantly over estimate the number of cpus available. Wheither via numactl, cgroups, taskset, systemd constraints, docker containers and probably other mechanisms, the number of threads mysqld can be run on can be quite less. As such we use the pthread_getaffinity_np function on Linux and FreeBSD (identical API) to get the number of CPUs. The number of CPUs is the default for the thread_pool_size and a too high default will resulting in large memory usage and high context switching overhead. Closes PR #922
Diffstat (limited to 'cmake')
-rw-r--r--cmake/os/WindowsCache.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index 1cb6c81b627..1dbedfc24f2 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -127,6 +127,8 @@ SET(HAVE_PTHREAD_ATTR_GETSTACKSIZE CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_SETSCOPE CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_SETSTACKSIZE CACHE INTERNAL "")
SET(HAVE_PTHREAD_CONDATTR_CREATE CACHE INTERNAL "")
+SET(HAVE_PTHREAD_CONDATTR_SETCLOCK CACHE INTERNAL "")
+SET(HAVE_PTHREAD_GETAFFINITY_NP CACHE INTERNAL "")
SET(HAVE_PTHREAD_INIT CACHE INTERNAL "")
SET(HAVE_PTHREAD_KEY_DELETE CACHE INTERNAL "")
SET(HAVE_PTHREAD_RWLOCK_RDLOCK CACHE INTERNAL "")