Commit c8f78875 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #4871 finish removing affinity stuff

git-svn-id: file:///svn/toku/tokudb@50311 c7de825b-a66e-492c-adef-691d508d4ae1
parent caafdfa8
...@@ -62,9 +62,6 @@ check_function_exists(malloc_usable_size HAVE_MALLOC_USABLE_SIZE) ...@@ -62,9 +62,6 @@ check_function_exists(malloc_usable_size HAVE_MALLOC_USABLE_SIZE)
## check whether we have memalign or valloc (a weak substitute for memalign on darwin) ## check whether we have memalign or valloc (a weak substitute for memalign on darwin)
check_function_exists(memalign HAVE_MEMALIGN) check_function_exists(memalign HAVE_MEMALIGN)
check_function_exists(valloc HAVE_VALLOC) check_function_exists(valloc HAVE_VALLOC)
## check whether we can pin processes to cpus
check_function_exists(cpuset_getaffinity HAVE_CPUSET_GETAFFINITY)
check_function_exists(sched_getaffinity HAVE_SCHED_GETAFFINITY)
## check whether we have random_r or nrand48 to use as a reentrant random function ## check whether we have random_r or nrand48 to use as a reentrant random function
check_function_exists(nrand48 HAVE_NRAND48) check_function_exists(nrand48 HAVE_NRAND48)
check_function_exists(random_r HAVE_RANDOM_R) check_function_exists(random_r HAVE_RANDOM_R)
......
...@@ -9,15 +9,6 @@ ...@@ -9,15 +9,6 @@
#include <unistd.h> #include <unistd.h>
#include <toku_assert.h> #include <toku_assert.h>
#include "toku_os.h" #include "toku_os.h"
#include <sched.h>
#if defined(HAVE_SCHED_GETAFFINITY)
static void set_cpuset(cpu_set_t *cpuset, int ncpus) {
CPU_ZERO(cpuset);
for (int i = 0; i < ncpus; i++)
CPU_SET(i, cpuset);
}
#endif
int main(void) { int main(void) {
int r; int r;
...@@ -27,18 +18,6 @@ int main(void) { ...@@ -27,18 +18,6 @@ int main(void) {
int max_cpus = sysconf(_SC_NPROCESSORS_ONLN); int max_cpus = sysconf(_SC_NPROCESSORS_ONLN);
assert(toku_os_get_number_active_processors() == max_cpus); assert(toku_os_get_number_active_processors() == max_cpus);
// change the processor affinity and verify that the correct number is computed
for (int ncpus = 1; ncpus <= max_cpus; ncpus++) {
#if defined(HAVE_SCHED_GETAFFINITY)
cpu_set_t cpuset;
set_cpuset(&cpuset, ncpus);
r = sched_setaffinity(getpid(), sizeof cpuset, &cpuset);
assert(r == 0);
assert(toku_os_get_number_active_processors() == ncpus);
#endif
}
// change the TOKU_NCPUS env variable and verify that the correct number is computed // change the TOKU_NCPUS env variable and verify that the correct number is computed
for (int ncpus = 1; ncpus <= max_cpus; ncpus++) { for (int ncpus = 1; ncpus <= max_cpus; ncpus++) {
char ncpus_str[32]; char ncpus_str[32];
......
...@@ -49,8 +49,6 @@ ...@@ -49,8 +49,6 @@
#cmakedefine HAVE_MALLOC_USABLE_SIZE 1 #cmakedefine HAVE_MALLOC_USABLE_SIZE 1
#cmakedefine HAVE_MEMALIGN 1 #cmakedefine HAVE_MEMALIGN 1
#cmakedefine HAVE_VALLOC 1 #cmakedefine HAVE_VALLOC 1
#cmakedefine HAVE_CPUSET_GETAFFINITY 1
#cmakedefine HAVE_SCHED_GETAFFINITY 1
#cmakedefine HAVE_NRAND48 1 #cmakedefine HAVE_NRAND48 1
#cmakedefine HAVE_RANDOM_R 1 #cmakedefine HAVE_RANDOM_R 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment