Skip to content

Commit

Permalink
scripts/bootstrap-prefix: change CPU usage suggestion for modern hard…
Browse files Browse the repository at this point in the history
…ware

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 <[email protected]>
  • Loading branch information
grobian committed Feb 2, 2024
1 parent 377f6f4 commit 885a6df
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/bootstrap-prefix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 885a6df

Please sign in to comment.