LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to make "make" use all cpus? (https://www.linuxquestions.org/questions/slackware-14/how-to-make-make-use-all-cpus-582187/)

kairen 09-04-2007 03:24 PM

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.

jnsg 09-04-2007 03:57 PM

Check this out (summary: use the -j option).

syg00 09-04-2007 04:24 PM

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.

clw54 09-04-2007 05:15 PM

I have a Core 2 Quad and make uses all four without any parameters.

Brian1 09-04-2007 05:30 PM

For dual core or dual processers use -j4. Use -j2 on a single to get a bit better performance.

Brian

perry 09-04-2007 10:26 PM

Quote:

Originally Posted by kairen (Post 2881186)
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.

When you say your compiling for 2.6.21.5 is it just 2.6.21.5 or is it really 2.6.21.5-smp ?

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

kairen 09-05-2007 05:59 AM

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.

kairen 09-07-2007 09:50 AM

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 :)

perry 09-07-2007 09:57 AM

Quote:

Originally Posted by kairen (Post 2884469)
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 :)

Do you have Dropline installed? I think you'll like more than just a KDE option on your system.

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:

If the desktop computer is powered by an ATX power supply unit that
reboots and shuts down the computer through software, you can enable APM
in Slack. Start the service, and uncomment apm in rc.modules to have it
auto-start on next boot:

modprobe apm
vi /etc/rc.d/rc.modules

/sbin/modprobe apm
- perry

kairen 09-07-2007 10:53 AM

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?

Spinlock 09-07-2007 11:41 AM

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.

perry 09-07-2007 12:11 PM

Quote:

Originally Posted by kairen (Post 2884543)
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?

thanks "kinda" important...!

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

kairen 09-07-2007 02:15 PM

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.