Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923616 - bootstrap-prefix.sh suggests too low MAKEOPTS on modern machines
Summary: bootstrap-prefix.sh suggests too low MAKEOPTS on modern machines
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-02 10:15 UTC by Mart Raudsepp
Modified: 2024-02-02 12:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Raudsepp gentoo-dev 2024-02-02 10:15:37 UTC
Currently bootstrap-prefix maxes out at MAKEOPTS=-j8 with this:

        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
        [[ -n ${USE_CPU_CORES} ]] && tcpu=${USE_CPU_CORES}
        cat << EOF


But I have 24 cores, 800GB/s memory bandwidth and 192GB RAM (M2 Ultra).
Could we somehow improve this logic to not cap it to 8 through some extra metrics? It's 2-3 times slower than it could be for me with the default when I don't notice to override.
Comment 1 Fabian Groffen gentoo-dev 2024-02-02 10:19:23 UTC
That old 8 core heuristic was for a T1/T2.  Feel free to drop it and up the number.  Perhaps keep it at 75% or something to be sure.  Note that you can use USE_CPU_CORES to override any logic.
Comment 2 Fabian Groffen gentoo-dev 2024-02-02 10:19:47 UTC
btw: congrats on your new beast :)
Comment 3 Mart Raudsepp gentoo-dev 2024-02-02 11:58:05 UTC
Thanks, it's not so new anymore by now though :)
I used to also need to force in a -Wl,-ld_classic in there, but with bootstrap-prefix.sh changes (last 6 commits or so), it seems to not be needed anymore somehow. Also python used to fail on not finding gettext stuff due to not linking to libintl, but that seems to have solved itself too somehow the past week.

Regarding the MAKEOPTS stuff, I'm not really sure what to do. I figured you'd want to keep the limit for the old machines and thought we can figure out some way to except apple silicon from the 8 cpu cap. Personally I'd want it to go up to 24-26 or so on the 24 cores, but some 75% to mostly keep the efficiency cores free doesn't feel too bad as a default either.

Personally I can just tell it 24 when it asks me, instead of letting it go with the default, but feels useful for the general public to improve this.
Comment 4 Fabian Groffen gentoo-dev 2024-02-02 12:15:56 UTC
Yes, bootstraps on OSX had some love in the past weeks.

I've pushed https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=885a6df29cfa5e73483f33c05fef8dac3f7ec55a I think this should do something more useful for todays hardware.