summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2021-07-29 21:08:30 -0700
committerRobert Mustacchi <rm@fingolfin.org>2021-07-30 13:28:41 -0700
commit1d806c5f41e9c01235a8d6889ebc483b3de3cf4c (patch)
tree544ffacd739a0257704b1e81dfb1d520f9602416 /usr/src
parentd48f713ac62c289b9e5d2c48645e62f4e644fe2a (diff)
downloadillumos-joyent-1d806c5f41e9c01235a8d6889ebc483b3de3cf4c.tar.gz
13982 excessive threads slows down find_elf
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Andy Fiddaman <andy@omnios.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/tools/scripts/find_elf.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr/src/tools/scripts/find_elf.pl b/usr/src/tools/scripts/find_elf.pl
index 58fc5f7059..96d5b24c7a 100644
--- a/usr/src/tools/scripts/find_elf.pl
+++ b/usr/src/tools/scripts/find_elf.pl
@@ -69,8 +69,20 @@ BEGIN {
}
}
+#
+# We need to clamp the maximum number of threads that we use. Because
+# this program is mostly an exercise in fork1, more threads doesn't
+# actually help us after a certain point as we just spend more and more
+# time trying to stop all of our LWPs than making forward progress.
+# We've seen experimentally on both 2P systems with 128 cores and 1P
+# systems with 16 cores that around 8 threads is a relative sweet spot.
+#
chomp (my $NPROCESSORS_ONLN = `getconf NPROCESSORS_ONLN 2>/dev/null` || 1);
my $max_threads = $ENV{DMAKE_MAX_JOBS} || $NPROCESSORS_ONLN;
+if ($max_threads > 8) {
+ $max_threads = 8;
+}
+
my $tq;
if ($Config{useithreads}) {