Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MAKEOPTS for a multicore CPU?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
vertaxis
n00b
n00b


Joined: 16 Sep 2005
Posts: 22

PostPosted: Fri May 18, 2007 7:12 pm    Post subject: MAKEOPTS for a multicore CPU? Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Fri May 18, 2007 7:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Fri May 18, 2007 9:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
vandien
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2006
Posts: 137

PostPosted: Fri May 18, 2007 11:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sat May 19, 2007 2:03 am    Post subject: Reply with quote

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
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Sat May 19, 2007 3:33 am    Post subject: Reply with quote

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
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Sat May 19, 2007 11:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum