View previous topic :: View next topic |
Author |
Message |
vertaxis n00b
Joined: 16 Sep 2005 Posts: 22
|
Posted: Fri May 18, 2007 7:12 pm Post subject: MAKEOPTS for a multicore CPU? |
|
|
I know this is a bit of a n00b question but I've never installed on a system with a multicore processor.
I will be installing Gentoo on a system with a mulitcore CPU this weekend; an AMD Athlon X2 4400+. What should MAKEOPTS in the make.conf be set to? Should it be MAKEOPTS="-j3"?
Thanks |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54300 Location: 56N 3W
|
Posted: Fri May 18, 2007 7:17 pm Post subject: |
|
|
vertaxis,
Thats a good starting point - its safe to experiment with higher numbers too. Eventually higher numbers will slow down compiles, not speed them up. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
devsk Advocate
Joined: 24 Oct 2003 Posts: 2995 Location: Bay Area, CA
|
Posted: Fri May 18, 2007 9:49 pm Post subject: |
|
|
on a dual core with current kernels and compiler, I found -j4 gives the best performance. -j5 is same as -j3, and -j6 is somewhere in between -j3 and -j2. sort of a normal curve peaking at -j4. |
|
Back to top |
|
|
vandien Tux's lil' helper
Joined: 03 May 2006 Posts: 137
|
Posted: Fri May 18, 2007 11:18 pm Post subject: |
|
|
run a test and let us know. like a kernel compile:
Code: | make clean; time make -j1
make clean; time make -j2
make clean; time make -j3
make clean; time make -j4
etc! |
|
|
Back to top |
|
|
devsk Advocate
Joined: 24 Oct 2003 Posts: 2995 Location: Bay Area, CA
|
Posted: Sat May 19, 2007 2:03 am Post subject: |
|
|
vandien wrote: | run a test and let us know. like a kernel compile:
Code: | make clean; time make -j1
make clean; time make -j2
make clean; time make -j3
make clean; time make -j4
etc! |
| you would need to repeat the thing at least two times to rule any kernel cache effects.
Bringing the file from filesystem into memory to compile is an IO operation (more expensive) the first time and a buffer cache access the second time. So, -j2 gets unfair advantage compared to -j1 in your test. Also, note that some of these files may tossed out from the cache during the 'make' because 1. kernel thinks they are tool old. 2. the memory is low. |
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5934
|
Posted: Sat May 19, 2007 3:33 am Post subject: |
|
|
typical settings for smp machines is 2x(amount of cores), or 2x(amount of cores) +1, or simply (amount of cores).
cheers _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Sat May 19, 2007 11:08 am Post subject: |
|
|
I use -j4 on my dual core as well. Works great! _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
|