Patchwork kernel.bbclass: Allow do_compile_kernelmodules to use PARALLEL_MAKE

login
register
mail settings
Submitter Richard Purdie
Date Dec. 10, 2011, 12:34 a.m.
Message ID <1323477267.5309.206.camel@ted>
Download mbox | patch
Permalink /patch/16631/
State Accepted
Commit 10b354c6ce7bac3b4cce5e6a649d4fd3ceca235b
Headers show

Comments

Richard Purdie - Dec. 10, 2011, 12:34 a.m.
Without this we don't take advantage of any configured multiple CPU
cores which seems a shame.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
Bruce Ashfield - Dec. 10, 2011, 12:36 a.m.
On 11-12-09 7:34 PM, Richard Purdie wrote:
> Without this we don't take advantage of any configured multiple CPU
> cores which seems a shame.

Agreed.

Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>

>
> Signed-off-by: Richard Purdie<richard.purdie@linuxfoundation.org>
> ---
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index d0cc279..120a524 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -89,7 +89,7 @@ kernel_do_compile() {
>   do_compile_kernelmodules() {
>   	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>   	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> +		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>   	else
>   		bbnote "no modules to compile"
>   	fi
>
>
Darren Hart - Dec. 10, 2011, 1:06 a.m.
On 12/09/2011 04:34 PM, Richard Purdie wrote:
> Without this we don't take advantage of any configured multiple CPU
> cores which seems a shame.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Thanks RP,

Acked-by: Darren Hart <dvhart@linux.intel.com>

> ---
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index d0cc279..120a524 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -89,7 +89,7 @@ kernel_do_compile() {
>  do_compile_kernelmodules() {
>  	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>  	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> +		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>  	else
>  		bbnote "no modules to compile"
>  	fi
> 
>
Khem Raj - Dec. 10, 2011, 11:28 p.m.
On Fri, Dec 9, 2011 at 4:34 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> Without this we don't take advantage of any configured multiple CPU
> cores which seems a shame.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index d0cc279..120a524 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -89,7 +89,7 @@ kernel_do_compile() {
>  do_compile_kernelmodules() {
>        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
>        if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
> -               oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
> +               oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
>        else
>                bbnote "no modules to compile"
>        fi


in base.bbclass oe_runmake says

${MAKE} ${EXTRA_OEMAKE} "$@"

and

conf/bitbake.conf says

EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "

hmmm so we dont parallel make if task is not called do_compile ?
Phil Blundell - Dec. 12, 2011, 6:21 p.m.
On Sat, 2011-12-10 at 15:28 -0800, Khem Raj wrote:
> in base.bbclass oe_runmake says
> 
> ${MAKE} ${EXTRA_OEMAKE} "$@"
> 
> and
> 
> conf/bitbake.conf says
> 
> EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
> 
> hmmm so we dont parallel make if task is not called do_compile ?

Indeed.  It's been that way basically forever; I think this was to avoid
a class of problems caused by trying to run "make install" with -j.  

It's possible that the general situation has improved a bit since that
code was written and it might be interesting to try enabling it for
install as well and see what happens.

p.
Khem Raj - Dec. 12, 2011, 6:31 p.m.
On Mon, Dec 12, 2011 at 10:21 AM, Phil Blundell <philb@gnu.org> wrote:
> Indeed.  It's been that way basically forever; I think this was to avoid
> a class of problems caused by trying to run "make install" with -j.

correct I wanted to highlight it since its important to know when we
write recipes
and have special compile steps
Richard Purdie - Dec. 12, 2011, 9:30 p.m.
On Mon, 2011-12-12 at 18:21 +0000, Phil Blundell wrote:
> On Sat, 2011-12-10 at 15:28 -0800, Khem Raj wrote:
> > in base.bbclass oe_runmake says
> > 
> > ${MAKE} ${EXTRA_OEMAKE} "$@"
> > 
> > and
> > 
> > conf/bitbake.conf says
> > 
> > EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
> > 
> > hmmm so we dont parallel make if task is not called do_compile ?
> 
> Indeed.  It's been that way basically forever; I think this was to avoid
> a class of problems caused by trying to run "make install" with -j.  
> 
> It's possible that the general situation has improved a bit since that
> code was written and it might be interesting to try enabling it for
> install as well and see what happens.

I recently merged patches to default to add PARALLEL_MAKE to do_install.
We have had surprisingly few issues with that. I think autotools itself
got fixed and hence so did anything using it. I guess anything with
broken makefiles already disables PARALLEL_MAKE so it seemed to work
pretty well.

Cheers,

Richard

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index d0cc279..120a524 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -89,7 +89,7 @@  kernel_do_compile() {
 do_compile_kernelmodules() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
 	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
-		oe_runmake modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
+		oe_runmake ${PARALLEL_MAKE} modules  CC="${KERNEL_CC}" LD="${KERNEL_LD}"
 	else
 		bbnote "no modules to compile"
 	fi