commit:     885a6df29cfa5e73483f33c05fef8dac3f7ec55a
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  2 12:13:02 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Feb  2 12:13:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=885a6df2

scripts/bootstrap-prefix: change CPU usage suggestion for modern hardware

Previous cap of 8 was based on old T1/T2.  Nowadays we can use more.

Suggest something along the lines of 50-75% of available CPUs to stay on
the modest side.  The user can override this in any case.

Closes: https://bugs.gentoo.org/923617
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 4622dc5d3e..5cb6d9f265 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -2565,12 +2565,9 @@ EOF
        esac
        # get rid of excess spaces (at least Solaris wc does)
        ncpu=$((ncpu + 0))
-       # Suggest usage of 100% to 60% of the available CPUs in the range
-       # from 1 to 14.  We limit to no more than 8, since we easily flood
-       # the bus on those heavy-core systems and only slow down in that
-       # case anyway.
-       local tcpu=$((ncpu / 2 + 1))
-       [[ ${tcpu} -gt 8 ]] && tcpu=8
+       # Suggest usage of 50% to 75% of the available CPUs
+       [[ ${tcpu} -eq 0 ]] && tcpu=1
+       local tcpu=$((((ncpu * 3) + 1) / 4))
        [[ -n ${USE_CPU_CORES} ]] && tcpu=${USE_CPU_CORES}
        cat << EOF
 

Reply via email to