]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
thread: Bump max detectable CPU from 16 to 128
authorDavid Goulet <dgoulet@torproject.org>
Fri, 28 Oct 2022 15:13:46 +0000 (11:13 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Fri, 28 Oct 2022 15:28:43 +0000 (11:28 -0400)
Lets take advantage of those beefy machines ;).

Closes #40703

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40703 [new file with mode: 0644]
src/lib/thread/numcpus.c
src/test/test_util.c

diff --git a/changes/ticket40703 b/changes/ticket40703
new file mode 100644 (file)
index 0000000..f005f8f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor feature (performance):
+    - Bump the maximum amount of CPU to use from 16 to 128. Note that NumCPUs
+      torrc option overrides this hardcoded maximum. Fixes bug 40703; bugfix on
+      0.3.5.1-alpha.
index 2c2589fdfe7be66a0fcbb1dda3a916d35b87725c..e0ddb699315d3c08e6e6a71694eadce4de707fec 100644 (file)
@@ -70,7 +70,11 @@ compute_num_cpus_impl(void)
 #endif /* defined(_WIN32) || ... */
 }
 
-#define MAX_DETECTABLE_CPUS 16
+/** This is an arbitrary number but at this point in time, it is not that
+ * uncommon to see servers up to that amount of CPUs. Most servers will likely
+ * be around 16 to 32 cores now. Lets take advantage of large machines! The
+ * "NumCPUs" torrc option overrides this maximum. */
+#define MAX_DETECTABLE_CPUS 128
 
 /** Return how many CPUs we are running with.  We assume that nobody is
  * using hot-swappable CPUs, so we don't recompute this after the first
index aa38d0fc5d49f87f5c7070d9fd4787d183850c61..1dae2c617efa85b70346ec8f4c1158defb1e4714 100644 (file)
@@ -4987,7 +4987,7 @@ test_util_num_cpus(void *arg)
     tt_skip();
 
   tt_int_op(num, OP_GE, 1);
-  tt_int_op(num, OP_LE, 16);
+  tt_int_op(num, OP_LE, 128);
 
  done:
   ;