Hello,

During a Gentoo update on a severly underpowered device (RPi4b; 4 core
+ 2GB RAM) I noticed strange behavior from make when building GCC:
It seems to estimate system load based on CPU alone, completely
ignoring IO's contribution.
I belive this is wrong for 2 reasons:
1) the option is called --load-average. Load average reported by linux
does include IO, so ignoring this part is surprising and confusing to
the user. E.g. THIS user. I am surprised and confused.
2) while compilation is mostly CPU-bound, it can consume enough RAM for
it to be a problem. A problem, which is easy to detect by the massive
load increase from hitting SWAP.

How I observed the behavior:
I'm looking at htop.
Make was launched with -j3 --load-average=3
When the compiller hits a big file, the system runs out of memory, 
load average jumps from ~3.4 to like 7-10, but 3 parallel jobs keep
running; whenever one job completes, a new one is started in its place.
Running yes > /dev/null from another terminal fully loads one core; one
parallel compilation job vanishes from htop.
After stopping yes, another job starts.

Repeated the above several times, with reliably reproducible results:
adding CPU load stops disk thrashing caused by swapping and actually
reduces system load.

Caught in the act: ebuild dev-build/make-4.4.1-r102
# make --version
GNU Make 4.4.1
Built for aarch64-unknown-linux-gnu

Thanks,
Bob

Reply via email to