This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC [testsuite] Obey --load-average
- From: Jeff Law <law at redhat dot com>
- To: Daniel Santos <daniel dot santos at pobox dot com>, gcc <gcc at gcc dot gnu dot org>, Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>, Mike Stump <mikestump at comcast dot net>
- Date: Thu, 3 Aug 2017 10:45:27 -0600
- Subject: Re: RFC [testsuite] Obey --load-average
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DDB8BA89C
- References: <ee0afe25-c283-9eb5-72af-e54ed818e6d6@pobox.com>
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/Makefile.in (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
success.
jeff