Re: Make --load-average ignores IO load
Buggy Bob <[email protected]> Thu, 16 Apr 2026 00:17:09 +0200
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2026-04-15 at 13:27 -0400, Paul Smith wrote: >=20 > Can you please try applying this patch and rebuilding GNU Make, and > see > if you get better results in your tests; this goes back (basically) > to > the older algorithm: >=20 > --- a/src/job.c > +++ b/src/job.c > @@ -2057,7 +2057,7 @@ load_too_high (void) > =C2=A0#else > =C2=A0=C2=A0 static double last_sec; > =C2=A0=C2=A0 static time_t last_now; > -=C2=A0 static int proc_fd =3D -2; > +=C2=A0 static int proc_fd =3D -1; >=20 > =C2=A0=C2=A0 double load, guess; > =C2=A0=C2=A0 time_t now; Thanks, with this patch applied it does look better indeed. It is difficult to really observe the absence, but it does "feel" better, since the device no longer freezes for extended periods of time. After the machine chokes on a big file, completed jobs are not replaced with new tasks until things settle down. That's the good thing. The bad thing is that once things do settle down, it immediately starts as many jobs as allowed by --jobs parameter, which on a moderately loaded machine results in oscilations: Suddenly starting a bunch of jobs pushes the load way above limit, then new jobs get held back, so the machine idles waiting for load estimate to go down, and then we go pedal to the metal overwheling it again and restarting the cycle. I mean, I can see why someone wanted to make it better. Maybe the old algorithm you mentioned just needs a rate limit on adding new parallel jobs instead of a whole new, better load estimation though? Say, a rule like "every 5 seconds increase current parallelism by (target load - current load)/2"? Kinda mirroring TCP's behavior in face of congestion. Should nicely smooth things out. Just putting it here as an idea. The 5 seconds suggested here matches how often linux kernel updates its own load average.