How to make "make" use all cpus?
Hi,
This is probably not the right forum for this question but I use Slackware and prefer to ask other slackers when in trouble. :) I have a laptop with Turion 64 x2 cpu. I am trying to compile a suitable kernel for it using the 2.6.21.5 that comes with Slackware12. So I compiled it a couple of times and noticed that during the compile only one of the cpus was used. A friend told me I can run "make" with an option to use both cpus simultaneously but I couldn't find how. I googled it but may be with wrong keywords.... Since I plan to work on that kernel for a while I am quite interested in making the compilation faster. Thanks in advance. |
Check this out (summary: use the -j option).
|
I was about to say a simple "man make" would have provided the answer, but I guess that's only true if you already have an idea what you're looking for.
I usually set jobs to one more than the number of (effective) CPUs. On my old hyperthreaded (PIII) Xeon quad (i.e. -j 9) kernel compiles fly. |
I have a Core 2 Quad and make uses all four without any parameters.
|
For dual core or dual processers use -j4. Use -j2 on a single to get a bit better performance.
Brian |
Quote:
It doesn't matter as much if your just getting one cpu to compile your kernel as much as are you compiling your kernel to use both available cpu's ? Take a look at my signature for the best instructions I've seen on the net on how to compile a Slackware 12 2.6.21.5-smp kernel (including the -j2 option) cheers - perry |
I looked at the man page before posting and somehow missed the -j option :(.
The kernel is "smp" and I can see Slack uses both cores. Thanks for the help. I will try this and post the result back here. |
Hi,
The "-j" think worked fine. Thanks!! Now I am trying to compile the "-smp" kernel with ACPI support but the kernel don't boot. If I remove ACPI it works fine but I miss battery support. At first I want to compile a custom kernel because the default hugesmp.s don't boot - it hangs after initializing the second cpu. huge.s boots fine but as it is no smp kernel it's of little use. Funny thing is I can boot with 64-bit kernel 2.6.21.3-smp from slamd which has ACPI compiled in. Same with 32-bit 2.6.13.17-smp from Slackware 11. I am not quite experienced with kernel stuff but I thing there is another thing I have to enable besides ACPI to make it work. As I said I have a Turion 64 x2 1.8GHz processor on DELL INSPIRON 1501 laptop. I tried to "kompare" .config files from the 3 kernels but may be they are too different (or I am too ignorant)- it didn't help at all. Thanks for the help :) |
Quote:
Further, try configuring with "make gconfig" as KDE's kernel configuration utility might have glitches. Also, have you specified your processor type for your kernel configuration? And be aware that "apm" is an alternative to acpi. Quote:
|
In the past I had really bad times trying to install and especially uninstall Dropline gnome so I don't want to try it now.
I specified the cpu as Optheron/K8 but I am not sure that is correct. As I know boxes with more then one cpu can't use APM for some reason. I read this somewhere during the xconfig - the notes about ACPI and APM I think.Is that correct? |
What would make you think that KDE's kernel config has glitches? I have had zero problems out of it... I don't really see how that's relevant.
kairen- What do you mean by your ACPI kernel "won't boot?" Does it hang at a certain spot, or never get past the loading screen? I would suspect that something else is to blame if other ACPI-configured kernels work fine. Also, a little bit of Googling revealed this. Apparently your model of laptop had a kernel bug as of last December. I don't know if it makes any difference at all anymore, but it may be something to look into. |
Quote:
break out your owner's manual, find out what you got cookin underneath the keyboard...! Are you sure you don't have this problem! (check your Starboard Bow) - perry |
The last few lines are
NET: Registered protocol family 2 Time: acpi_pm clocksource has been installed. Switched to high resolution mode on CPU 0 Switched to high resolution mode on CPU 1 I don't know what that meens. I compiled 1 kernel without ACPI - it works fine . Then I recompiled it just switching ACPI on - that is the result. |
All times are GMT -5. The time now is 04:20 PM. |