diff options
author | Vijay Pai <vpai@google.com> | 2017-10-19 14:32:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-19 14:32:46 -0700 |
commit | 8514a510d5ce08e238f7344fb83984048eae0408 (patch) | |
tree | c889d15cf4e88002814f1120ab279bafbd516b40 | |
parent | c7ea15e9b708283a1c6848bcb8a81e99aa082a8b (diff) |
Revert "cpu_linux: Don't spam sched_getcpu failures on qemu"
-rw-r--r-- | src/core/lib/support/cpu_linux.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/lib/support/cpu_linux.cc b/src/core/lib/support/cpu_linux.cc index 53619caa5f..2280668442 100644 --- a/src/core/lib/support/cpu_linux.cc +++ b/src/core/lib/support/cpu_linux.cc @@ -38,9 +38,8 @@ static int ncpus = 0; static void init_num_cpus() { /* This must be signed. sysconf returns -1 when the number cannot be determined */ - int cpu = sched_getcpu(); ncpus = (int)sysconf(_SC_NPROCESSORS_ONLN); - if (ncpus < 1 || cpu < 0) { + if (ncpus < 1) { gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1"); ncpus = 1; } @@ -57,9 +56,6 @@ unsigned gpr_cpu_current_cpu(void) { // sched_getcpu() is undefined on musl return 0; #else - if (gpr_cpu_num_cores() == 1) { - return 0; - } int cpu = sched_getcpu(); if (cpu < 0) { gpr_log(GPR_ERROR, "Error determining current CPU: %s\n", strerror(errno)); |