Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 490624 - www-client/chromium exhibits ridiculous loads with parallel builds
Summary: www-client/chromium exhibits ridiculous loads with parallel builds
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on: 490620
Blocks:
  Show dependency tree
 
Reported: 2013-11-06 22:12 UTC by M. B.
Modified: 2014-05-18 10:45 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
chromium-30.0.1599.101-r1.ebuild (chromium-30.0.1599.101-r1.ebuild,17.07 KB, text/plain)
2013-11-06 22:16 UTC, M. B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description M. B. 2013-11-06 22:12:50 UTC
When building chromium in parallel (e.g. MAKEOPTS="-jN" with N>1), it just blindly forks build-processes, irrespective of the current system load.

I patched the current stable ebuild on my system to take advantage of an enhancement I submitted in https://bugs.gentoo.org/show_bug.cgi?id=490620 .

Reproducible: Always
Comment 1 M. B. 2013-11-06 22:16:23 UTC
Created attachment 362708 [details]
chromium-30.0.1599.101-r1.ebuild

please note: this ebuild only works in conjunction with the eclass from bug 490620.
Comment 2 M. B. 2013-11-06 22:19:36 UTC
$ diff -Naur /usr/portage/www-client/chromium/chromium-30.0.1599.101.ebuild chromium-30.0.1599.101-r1.ebuild 
--- /usr/portage/www-client/chromium/chromium-30.0.1599.101.ebuild	2013-10-16 15:01:36.000000000 +0200
+++ chromium-30.0.1599.101-r1.ebuild	2013-11-06 23:14:46.253242314 +0100
@@ -379,7 +379,11 @@
 
 	# Even though ninja autodetects number of CPUs, we respect
 	# user's options, for debugging with -j 1 or any other reason.
-	ninja -C out/Release -v -j $(makeopts_jobs) ${ninja_targets} || die
+	ninja -C out/Release \
+	      -v \
+	      -j $(makeopts_jobs) \
+	      -l $(makeopts_loadavg) \
+	      ${ninja_targets} || die
 
 	pax-mark m out/Release/chrome
 	if use test; then
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-12-03 21:33:12 UTC
(In reply to M. B. from comment #2)
> $ diff -Naur /usr/portage/www-client/chromium/chromium-30.0.1599.101.ebuild
> chromium-30.0.1599.101-r1.ebuild 
> --- /usr/portage/www-client/chromium/chromium-30.0.1599.101.ebuild
> 2013-10-16 15:01:36.000000000 +0200
> +++ chromium-30.0.1599.101-r1.ebuild	2013-11-06 23:14:46.253242314 +0100
> @@ -379,7 +379,11 @@
>  
>  	# Even though ninja autodetects number of CPUs, we respect
>  	# user's options, for debugging with -j 1 or any other reason.
> -	ninja -C out/Release -v -j $(makeopts_jobs) ${ninja_targets} || die
> +	ninja -C out/Release \
> +	      -v \
> +	      -j $(makeopts_jobs) \
> +	      -l $(makeopts_loadavg) \
> +	      ${ninja_targets} || die
>  
>  	pax-mark m out/Release/chrome
>  	if use test; then

Thank you for your contribution. It's generally good, but I'd like to see one issue addressed before this can get accepted: without -l in the MAKEOPTS, I think this will result in passing -l 1 to ninja.

This is different from the previous behavior, which would not add any loadavg limits.

Could you modify the patch so that -l is only passed to ninja when -l is actually set in the MAKEOPTS?

Note that while it's reasonable to assume -j 1 if it's not present in MAKEOPTS, I don't think the same reasoning would apply to -l (which is much less common flag and most people don't have it set).
Comment 4 Mike Gilbert gentoo-dev 2013-12-08 03:24:38 UTC
(In reply to Paweł Hajdan, Jr. from comment #3)

I went ahead and committed a solution to the latest ebuild. If you think it looks ok, I will copy it to the beta and stable channel ebuilds.

+  08 Dec 2013; Mike Gilbert <floppym@gentoo.org> chromium-33.0.1726.0.ebuild:
+  Refactor ninja option processing into eninja function. Add load average
+  support, thanks to M.B. in bug 490624.
Comment 5 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-12-10 05:21:10 UTC
(In reply to Mike Gilbert from comment #4)
> I went ahead and committed a solution to the latest ebuild. If you think it
> looks ok, I will copy it to the beta and stable channel ebuilds.

Sounds good, code looks OK. Thanks. I'd slightly prefer not to modify stable ebuilds, even with seemingly safe changes (unless they fix really serious bugs affecting large part of our user base). Up to you.
Comment 6 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2014-05-18 10:45:33 UTC
(In reply to Mike Gilbert from comment #4)
> (In reply to Paweł Hajdan, Jr. from comment #3)
> 
> I went ahead and committed a solution to the latest ebuild. If you think it
> looks ok, I will copy it to the beta and stable channel ebuilds.
> 
> +  08 Dec 2013; Mike Gilbert <floppym@gentoo.org>
> chromium-33.0.1726.0.ebuild:
> +  Refactor ninja option processing into eninja function. Add load average
> +  support, thanks to M.B. in bug 490624.

Since chromium-34 is now stable I'm closing this as fixed.