public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Safety of -j N when building kernels?
@ 2002-05-22 16:53 Eric Weigle
  2002-05-22 17:24 ` William Park
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Eric Weigle @ 2002-05-22 16:53 UTC (permalink / raw)
  To: Linux kernel mailing list (lkml)

Ok, stupid question of the moment-

I always read about the kernel compilation benchmarks people run on the
ultra-snazzy new machines, but do people actually run the kernels thus
generated?

I have visions of a process being backgrounded to generate some files, and
not completing before the one of the old files gets linked into the kernel
(because not all files were listed as dependencies, for example).

So are the kernel's current Makefiles really SMP safe -- can one really
run multiple jobs when building Linux kernels? Any horror stories, or am
I just paranoid?


Thanks
-Eric

-- 
--------------------------------------------
 Eric H. Weigle   CCS-1, RADIANT team
 ehw@lanl.gov     Los Alamos National Lab
 (505) 665-4937   http://home.lanl.gov/ehw/
--------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Safety of -j N when building kernels?
  2002-05-22 16:53 Safety of -j N when building kernels? Eric Weigle
@ 2002-05-22 17:24 ` William Park
  2002-05-22 17:31 ` Fernando [Quatro]
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: William Park @ 2002-05-22 17:24 UTC (permalink / raw)
  To: Linux kernel mailing list (lkml)

On Wed, May 22, 2002 at 10:53:20AM -0600, Eric Weigle wrote:
> Ok, stupid question of the moment-
> 
> I always read about the kernel compilation benchmarks people run on the
> ultra-snazzy new machines, but do people actually run the kernels thus
> generated?
> 
> I have visions of a process being backgrounded to generate some files, and
> not completing before the one of the old files gets linked into the kernel
> (because not all files were listed as dependencies, for example).
> 
> So are the kernel's current Makefiles really SMP safe -- can one really
> run multiple jobs when building Linux kernels? Any horror stories, or am
> I just paranoid?

I usually do
    make menuconfig
    make -j3 dep
    make -j3 bzImage modules	
    make -j3 bzlilo modules_install
where I separate the compile and install part.  But, this depends on what
you are compiling.  I usually have problem with Compaq and Hamradio stuffs,
so I have them commented out.

-- 
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>
8-CPU Cluster, Hosting, NAS, Linux, LaTeX, python, vim, mutt, tin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Safety of -j N when building kernels?
  2002-05-22 16:53 Safety of -j N when building kernels? Eric Weigle
  2002-05-22 17:24 ` William Park
@ 2002-05-22 17:31 ` Fernando [Quatro]
  2002-05-22 18:29 ` Samuel Flory
  2002-05-22 23:32 ` Keith Owens
  3 siblings, 0 replies; 6+ messages in thread
From: Fernando [Quatro] @ 2002-05-22 17:31 UTC (permalink / raw)
  To: Eric Weigle; +Cc: Linux kernel mailing list (lkml)

> Ok, stupid question of the moment-
> 
> I always read about the kernel compilation benchmarks people run on the
> ultra-snazzy new machines, but do people actually run the kernels thus
> generated?
> 
> I have visions of a process being backgrounded to generate some files, and
> not completing before the one of the old files gets linked into the kernel
> (because not all files were listed as dependencies, for example).
> 
> So are the kernel's current Makefiles really SMP safe -- can one really
> run multiple jobs when building Linux kernels? Any horror stories, or am
> I just paranoid?

I think it's safe... I ran a `make -j` once (dual pIII 933MHz, 1Gb RAM).
The load average went to 200+!  In the end, the kernel was fine and booted
all right... I don't do that anymore because it takes longer building with a sane number
in 'make -j N'...




--------------------------------------------------
Fernando Korndorfer - fernando@quatro.com.br
Quatro Informatica Ltda.
Novo Hamburgo - RS/Brasil
--------------------------------------------------


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Safety of -j N when building kernels?
  2002-05-22 16:53 Safety of -j N when building kernels? Eric Weigle
  2002-05-22 17:24 ` William Park
  2002-05-22 17:31 ` Fernando [Quatro]
@ 2002-05-22 18:29 ` Samuel Flory
  2002-05-22 20:03   ` James Stevenson
  2002-05-22 23:32 ` Keith Owens
  3 siblings, 1 reply; 6+ messages in thread
From: Samuel Flory @ 2002-05-22 18:29 UTC (permalink / raw)
  To: Eric Weigle; +Cc: Linux kernel mailing list (lkml)

   The only major issue I've seen is the build may fail if you run out 
of file handles, or other resources.  The build will fail with an 
"unable to fork" error.  When I was at VA Linux I often compiled kernel 
for use with a make -j 16, or -j 8.  I seem to remember having to play 
with ulimit, and /proc/?/file-max to get enough file handles.


PS- You should also consider logging the output of your compile to a 
file.  As your other jobs will continue for sometime before the make 
fails.  Often preventing you from easily finding the actual compile error.

Eric Weigle wrote:
> Ok, stupid question of the moment-
> 
> I always read about the kernel compilation benchmarks people run on the
> ultra-snazzy new machines, but do people actually run the kernels thus
> generated?
> 
> I have visions of a process being backgrounded to generate some files, and
> not completing before the one of the old files gets linked into the kernel
> (because not all files were listed as dependencies, for example).
> 
> So are the kernel's current Makefiles really SMP safe -- can one really
> run multiple jobs when building Linux kernels? Any horror stories, or am
> I just paranoid?
> 
> 
> Thanks
> -Eric
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Safety of -j N when building kernels?
  2002-05-22 18:29 ` Samuel Flory
@ 2002-05-22 20:03   ` James Stevenson
  0 siblings, 0 replies; 6+ messages in thread
From: James Stevenson @ 2002-05-22 20:03 UTC (permalink / raw)
  To: Samuel Flory, Eric Weigle; +Cc: Linux kernel mailing list (lkml)

>    The only major issue I've seen is the build may fail if you run out
> of file handles, or other resources.  The build will fail with an
> "unable to fork" error.  When I was at VA Linux I often compiled kernel
> for use with a make -j 16, or -j 8.  I seem to remember having to play
> with ulimit, and /proc/?/file-max to get enough file handles.
>
>
> PS- You should also consider logging the output of your compile to a
> file.  As your other jobs will continue for sometime before the make
> fails.  Often preventing you from easily finding the actual compile error.

of course you should only really need to log the stderr or redirect stderr
to somewhere you can see it.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Safety of -j N when building kernels?
  2002-05-22 16:53 Safety of -j N when building kernels? Eric Weigle
                   ` (2 preceding siblings ...)
  2002-05-22 18:29 ` Samuel Flory
@ 2002-05-22 23:32 ` Keith Owens
  3 siblings, 0 replies; 6+ messages in thread
From: Keith Owens @ 2002-05-22 23:32 UTC (permalink / raw)
  To: Eric Weigle; +Cc: Linux kernel mailing list (lkml)

On Wed, 22 May 2002 10:53:20 -0600, 
Eric Weigle <ehw@lanl.gov> wrote:
>So are the kernel's current Makefiles really SMP safe -- can one really
>run multiple jobs when building Linux kernels? Any horror stories, or am
>I just paranoid?

make dep is not parallel safe.  On some architectures make -jN dep will
generate corrupt data, especially with module symbol versions.  You
might get away with it.

It is not safe on any architecture to make -jN *config dep bzImage
modules in one command, you need three separate commands for make -jN
*config, make -jN dep and make -jN bzImage modules.  The install step
must also be a separate command.

Building bzImage and modules should be parallel safe, as long as your
machine can take the cpu load and has enough file descriptors.
Sometimes people do not understand makefiles so the odd driver may not
build correctly.  aic7xxx around 2.4.19-pre5 was not parallel safe.

Of course, in kbuild 2.5, all of this is parallel safe.  make -j
*config install works fine.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-22 23:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-22 16:53 Safety of -j N when building kernels? Eric Weigle
2002-05-22 17:24 ` William Park
2002-05-22 17:31 ` Fernando [Quatro]
2002-05-22 18:29 ` Samuel Flory
2002-05-22 20:03   ` James Stevenson
2002-05-22 23:32 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox