This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC [testsuite] Obey --load-average

On 08/02/2017 11:34 PM, Daniel Santos wrote:
> I'm working on a patch to modify the testsuite to obey the
> --load-average value if one is passed to make.  It seems to work pretty
> well, except for libstdc++ which doesn't load gcc/libs/gcc-defs.exp
> since it defines it's own ${tool}_functions.  I haven't dug too deeply
> into libstdc++'s testsuite yet, but how does it manage parallelization
> if it isn't using the routines in gcc-defs.exp?  I'm thinking I will
> need a separate load-limit.exp file or some such.
> This feature would be very helpful since you cannot interrupt a test run
> and restart from where you left off.  Also, if you suspend the job, then
> you will get timeouts.  So it would be helpful to have a way to have it
> yield when you need to do something else on your machine, or if you're
> using a shared test machine and you want to use all available CPU, but
> not crowd out other users.
> Due to not having actual interprocess communication, the check_cpu_load
> procedure uses an algo that gives lower numbered jobs slightly more
> priority than higher numbered jobs.  When the load average is exceeded,
> the job sleeps an amount of time based upon the "priority" (lower
> numbered jobs sleep less) and a random number - this helps prevent feast
> or famine cycles where all jobs stop when the load is too high and then
> all jobs start again and saturate the CPUs, bouncing back and forth.
> gcc/testsuite/ChangeLog
> 	* gcc/ (check-parallel-%): Export job number to environment.
> 	* gcc/testsuite/lib/gcc-defs.exp (num_jobs, load_max, getloadavg_exe):
> 	New global variables.
> 	(check_cpu_load): New proc to check speed limit.
> 	(gcc_parallel_test_run_p): Modify to call check_cpu_load before
> 	acquiring a new lock file.
So does this perform better than make -j X -l X?  I use that with good


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]