Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I noticed that my processors were, in total, in use only about 50% of the time while making a Linux kernel.

I usually make the kernel, then make the modules.

I have just started a make bzImage in one terminal and a make modules in another and see that both my processors are in full use. I expect the total compile time will be a lot quicker as I'm compiling in parallel instead of serial.

Are there any "gotya's" that make this unsafe?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Just use make -j 3 and it should compile in paralell, and will ensure any dependencies are properly handeled, this is the "official" way to do it.

share|improve this answer
    
on a two-core system (50% utilization suggests this) -j 2 would be a better idea. With -j 3, system constantly forced to context changes by enforcing 3 jobs on 2 processor threads. BTW the questioner's correct answer is "make -j 2 bzImage modules" –  asdmin Sep 5 '09 at 7:27
2  
@asdmin - Because of the way make does paralellism, with <= 4 cores it's better to do N+1, above that there's not as much benefit as IO becomes the bottleneck. –  LapTop006 Sep 5 '09 at 11:36

And no, you should not start building two objects in the same directory that are likely to try and compile the same code at the same time.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.