fosslinux / live-bootstrap

Use of a Linux initramfs to fully automate the bootstrapping process
291 stars 26 forks source link

Support swap files in qemu or bare-metal mode #387

Closed Googulator closed 6 months ago

Googulator commented 6 months ago

This can help alleviate memory pressure when bootstrapping with high core counts.

stikonas commented 6 months ago

Hmm, codewise looks good, but generally I think swapping during build is bad for performance. I usually find that reducing number of threads to avoid swapping is more helpful. Or did you observe different behaviour in live-bootstrap?

Googulator commented 6 months ago

In the case of live-bootstrap, when going from 4 to 8 threads, the slight performance hit from occasionally hitting swap in GCC13 (the only place where 8 threads would otherwise go OOM) is far outweighed by the speed gain in Guile, especially on SSDs or other Flash storage. Haven't tested on an HDD though, results might be different there.

Also, Linux 4.9.10 is AFAIK already new enough to use swap in conjunction with disk caching even when there's no direct memory pressure, to increase performance.