diff mbox

kbuild: Do not run modules_install and install in paralel

Message ID 1402652395-28779-1-git-send-email-mmarek@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Marek June 13, 2014, 9:39 a.m. UTC
Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>

With modular kernels, 'make install' is going to need the installed
modules at some point to generate the initramfs.

Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Michal Marek June 13, 2014, 9:45 a.m. UTC | #1
Dne 13.6.2014 11:39, Michal Marek napsal(a):
> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
> 
> With modular kernels, 'make install' is going to need the installed
> modules at some point to generate the initramfs.
> 
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
>  Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 7680d7c..7e5e483 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>                  endif
>          endif
>  endif
> +# install and module_install need also be processed one by one
> +ifneq ($(filter install,$(MAKECMDGOALS)),)
> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
> +	        mixed-targets := 1
> +        endif
> +endif

Note that this version does not enforce the ordering, it just avoids the
interleaved execution. It can be added if desired.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Lutomirski June 13, 2014, 5:29 p.m. UTC | #2
On Fri, Jun 13, 2014 at 2:45 AM, Michal Marek <mmarek@suse.cz> wrote:
> Dne 13.6.2014 11:39, Michal Marek napsal(a):
>> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
>>
>> With modular kernels, 'make install' is going to need the installed
>> modules at some point to generate the initramfs.
>>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>>  Makefile | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 7680d7c..7e5e483 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>>                  endif
>>          endif
>>  endif
>> +# install and module_install need also be processed one by one
>> +ifneq ($(filter install,$(MAKECMDGOALS)),)
>> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
>> +             mixed-targets := 1
>> +        endif
>> +endif
>
> Note that this version does not enforce the ordering, it just avoids the
> interleaved execution. It can be added if desired.

Hmm.  This will fix 'make modules_install install' but will not fix
'make install modules_install'.  I don't know how many people would
type the latter.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek July 4, 2014, 10:15 p.m. UTC | #3
Dne 13.6.2014 19:29, Andy Lutomirski napsal(a):
> On Fri, Jun 13, 2014 at 2:45 AM, Michal Marek <mmarek@suse.cz> wrote:
>> Dne 13.6.2014 11:39, Michal Marek napsal(a):
>>> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
>>>
>>> With modular kernels, 'make install' is going to need the installed
>>> modules at some point to generate the initramfs.
>>>
>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>> ---
>>>  Makefile | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 7680d7c..7e5e483 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>>>                  endif
>>>          endif
>>>  endif
>>> +# install and module_install need also be processed one by one
>>> +ifneq ($(filter install,$(MAKECMDGOALS)),)
>>> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
>>> +             mixed-targets := 1
>>> +        endif
>>> +endif
>>
>> Note that this version does not enforce the ordering, it just avoids the
>> interleaved execution. It can be added if desired.
> 
> Hmm.  This will fix 'make modules_install install' but will not fix
> 'make install modules_install'.  I don't know how many people would
> type the latter.

Resuming a thread from last month -- As I said, it does not enforce the
ordering. So it's not as bullet-proof as your patch, but it works on all
architectures. I'm thinking about adding the patch to kbuild.git for
3.17. But if you want to fix the ordering as well, feel free to change
the __build_one_by_one rule to do this.

Thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Lutomirski July 4, 2014, 11:45 p.m. UTC | #4
On Fri, Jul 4, 2014 at 3:15 PM, Michal Marek <mmarek@suse.cz> wrote:
> Dne 13.6.2014 19:29, Andy Lutomirski napsal(a):
>> On Fri, Jun 13, 2014 at 2:45 AM, Michal Marek <mmarek@suse.cz> wrote:
>>> Dne 13.6.2014 11:39, Michal Marek napsal(a):
>>>> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
>>>>
>>>> With modular kernels, 'make install' is going to need the installed
>>>> modules at some point to generate the initramfs.
>>>>
>>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>>> ---
>>>>  Makefile | 6 ++++++
>>>>  1 file changed, 6 insertions(+)
>>>>
>>>> diff --git a/Makefile b/Makefile
>>>> index 7680d7c..7e5e483 100644
>>>> --- a/Makefile
>>>> +++ b/Makefile
>>>> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>>>>                  endif
>>>>          endif
>>>>  endif
>>>> +# install and module_install need also be processed one by one
>>>> +ifneq ($(filter install,$(MAKECMDGOALS)),)
>>>> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
>>>> +             mixed-targets := 1
>>>> +        endif
>>>> +endif
>>>
>>> Note that this version does not enforce the ordering, it just avoids the
>>> interleaved execution. It can be added if desired.
>>
>> Hmm.  This will fix 'make modules_install install' but will not fix
>> 'make install modules_install'.  I don't know how many people would
>> type the latter.
>
> Resuming a thread from last month -- As I said, it does not enforce the
> ordering. So it's not as bullet-proof as your patch, but it works on all
> architectures. I'm thinking about adding the patch to kbuild.git for
> 3.17. But if you want to fix the ordering as well, feel free to change
> the __build_one_by_one rule to do this.

Sounds good to me.

Where's __build_one_by_one?

--Andy

>
> Thanks,
> Michal
Michal Marek July 7, 2014, 11:03 a.m. UTC | #5
On 2014-07-05 01:45, Andy Lutomirski wrote:
> On Fri, Jul 4, 2014 at 3:15 PM, Michal Marek <mmarek@suse.cz> wrote:
>> Dne 13.6.2014 19:29, Andy Lutomirski napsal(a):
>>> On Fri, Jun 13, 2014 at 2:45 AM, Michal Marek <mmarek@suse.cz> wrote:
>>>> Dne 13.6.2014 11:39, Michal Marek napsal(a):
>>>>> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
>>>>>
>>>>> With modular kernels, 'make install' is going to need the installed
>>>>> modules at some point to generate the initramfs.
>>>>>
>>>>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>>>>> ---
>>>>>  Makefile | 6 ++++++
>>>>>  1 file changed, 6 insertions(+)
>>>>>
>>>>> diff --git a/Makefile b/Makefile
>>>>> index 7680d7c..7e5e483 100644
>>>>> --- a/Makefile
>>>>> +++ b/Makefile
>>>>> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>>>>>                  endif
>>>>>          endif
>>>>>  endif
>>>>> +# install and module_install need also be processed one by one
>>>>> +ifneq ($(filter install,$(MAKECMDGOALS)),)
>>>>> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
>>>>> +             mixed-targets := 1
>>>>> +        endif
>>>>> +endif
>>>>
>>>> Note that this version does not enforce the ordering, it just avoids the
>>>> interleaved execution. It can be added if desired.
>>>
>>> Hmm.  This will fix 'make modules_install install' but will not fix
>>> 'make install modules_install'.  I don't know how many people would
>>> type the latter.
>>
>> Resuming a thread from last month -- As I said, it does not enforce the
>> ordering. So it's not as bullet-proof as your patch, but it works on all
>> architectures. I'm thinking about adding the patch to kbuild.git for
>> 3.17. But if you want to fix the ordering as well, feel free to change
>> the __build_one_by_one rule to do this.
> 
> Sounds good to me.
> 
> Where's __build_one_by_one?

A few lines below in the main Makefile:

   513  ifeq ($(mixed-targets),1)
   514  #
======================================================================
=====
   515  # We're called with mixed targets (*config and build targets).
   516  # Handle them one by one.
   517
   518  PHONY += $(MAKECMDGOALS) __build_one_by_one
   519
   520  $(filter-out __build_one_by_one, $(MAKECMDGOALS)):
__build_one_by_one
   521          @:
   522
   523  __build_one_by_one:
   524          $(Q)set -e; \
   525          for i in $(MAKECMDGOALS); do \
   526                  $(MAKE) -f $(srctree)/Makefile $$i; \
   527          done

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Lutomirski Dec. 9, 2015, 9:34 p.m. UTC | #6
On Fri, Jun 13, 2014 at 2:39 AM, Michal Marek <mmarek@suse.cz> wrote:
> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
>
> With modular kernels, 'make install' is going to need the installed
> modules at some point to generate the initramfs.
>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
>  Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 7680d7c..7e5e483 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>                  endif
>          endif
>  endif
> +# install and module_install need also be processed one by one
> +ifneq ($(filter install,$(MAKECMDGOALS)),)
> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
> +               mixed-targets := 1
> +        endif
> +endif
>
>  ifeq ($(mixed-targets),1)
>  # ===========================================================================
> --
> 1.9.2
>

This patch seems to have gotten lost.  Do you still like it?  If so,
can someone apply it, please?

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek Dec. 10, 2015, 2:45 p.m. UTC | #7
Dne 9.12.2015 v 22:34 Andy Lutomirski napsal(a):
> On Fri, Jun 13, 2014 at 2:39 AM, Michal Marek <mmarek@suse.cz> wrote:
>> Based on a x86-only patch by Andy Lutomirski <luto@amacapital.net>
>>
>> With modular kernels, 'make install' is going to need the installed
>> modules at some point to generate the initramfs.
>>
>> Signed-off-by: Michal Marek <mmarek@suse.cz>
>> ---
>>  Makefile | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 7680d7c..7e5e483 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -503,6 +503,12 @@ ifeq ($(KBUILD_EXTMOD),)
>>                  endif
>>          endif
>>  endif
>> +# install and module_install need also be processed one by one
>> +ifneq ($(filter install,$(MAKECMDGOALS)),)
>> +        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
>> +               mixed-targets := 1
>> +        endif
>> +endif
>>
>>  ifeq ($(mixed-targets),1)
>>  # ===========================================================================
>> --
>> 1.9.2
>>
> 
> This patch seems to have gotten lost.  Do you still like it?  If so,
> can someone apply it, please?

Oops. I will rebase it and apply to the kbuild tree.

Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 7680d7c..7e5e483 100644
--- a/Makefile
+++ b/Makefile
@@ -503,6 +503,12 @@  ifeq ($(KBUILD_EXTMOD),)
                 endif
         endif
 endif
+# install and module_install need also be processed one by one
+ifneq ($(filter install,$(MAKECMDGOALS)),)
+        ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
+	        mixed-targets := 1
+        endif
+endif
 
 ifeq ($(mixed-targets),1)
 # ===========================================================================