Re: compile ports and base using both cores

2007-11-07 Thread Chris Whitehouse

Chris Whitehouse wrote:

Hi,

Installing ports or upgrading the base system only uses around 50% cpu 
utilization (measured with the top utility) on my dual core machine. Is 
there some way I can get higher cpu usage?


/usr/src/UPDATING says don't use make -j. I tried installing 
openoffice.org-2 with make -j 2 but it failed at some stage saying it 
couldn't find a directory. It works not using -j.


I'm using 7.0-BETA1.5 i386 on an AMD 64 system.

Thanks

Chris


Hi again,

I was wondering if anyone could give me some ideas about this. Btw I 
confess the subject line is not quite right, I think both cores are 
being used but cpu is only around 50% - or it is being measured so that 
it looks like 50% but is really more. If I make buildworld and compile a 
 port at the same time then cpu usage really does go up to 100%


While building world, repeatedly doing top -d 1 | grep -e make -e cc; 
echo # to make a blank line between outputs:


18067 root  1   80  4960K  3792K wait   1   0:00  5.64% make
18100 root  1  970 14628K 12780K CPU1   0   0:00  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3792K wait   1   0:00  5.64% make
18100 root  1 1000 21820K 20172K CPU1   0   0:00  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3792K wait   1   0:00  5.13% make
18100 root  1 1000 24916K 23220K CPU1   0   0:01  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18100 root  1 1030 26972K 24880K CPU1   0   0:01 82.00% cc1
18067 root  1   80  4960K  3792K wait   1   0:00  3.50% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18100 root  1 1070 29036K 26944K CPU1   0   0:02 82.00% cc1
18067 root  1   80  4960K  3792K wait   1   0:00  3.50% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18100 root  1 1050 32156K 29996K CPU1   0   0:02 177.00% cc1
18067 root  1   80  4960K  3792K wait   1   0:00  2.42% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3816K wait   0   0:00  2.42% make
18116 root  1  980 20796K 19084K CPU1   0   0:00  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3816K wait   0   0:00  2.42% make
18116 root  1 1010 22852K 21388K CPU1   0   0:01  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18116 root  1 1020 25924K 24224K CPU0   1   0:01 80.00% cc1
18067 root  1   80  4960K  3816K wait   0   0:00  1.76% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18116 root  1 1050 29028K 27096K CPU1   1   0:01 80.00% cc1
18067 root  1   80  4960K  3816K wait   0   0:00  1.76% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18116 root  1 1080 31076K 29740K CPU1   0   0:02 80.00% cc1
18067 root  1   80  4960K  3816K wait   0   0:00  1.76% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18116 root  1 1070 34172K 33204K CPU0   1   0:02 91.74% cc1
18067 root  1   80  4960K  3816K wait   0   0:00  1.32% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18116 root  1 1100 37308K 36064K CPU1   0   0:02 91.74% cc1
18067 root  1   80  4960K  3816K wait   0   0:00  1.32% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3832K wait   0   0:00  0.99% make
18134 root  1  960 14644K 12904K CPU0   1   0:00  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3832K wait   0   0:00  0.99% make
18134 root  1  990 19772K 18476K CPU1   1   0:00  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3852K wait   1   0:00  0.99% make
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make
14892 root  1   80  1888K   832K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3852K wait   1   0:00  0.74% make
18142 root  1  980 18740K 16796K CPU1   1   0:00  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

18067 root  1   80  4960K  3852K wait   1   0:00  0.74% make
18142 root  1 1010 20796K 19624K CPU1   1   0:01  0.00% cc1
 1318 root  1   80  1888K   816K wait   0   0:00  0.00% make

thanks

Chris



___
freebsd-questions@freebsd.org mailing 

Re: compile ports and base using both cores

2007-11-07 Thread Philip M. Gollucci

Chris Whitehouse wrote:

Chris Whitehouse wrote:

Hi,

Installing ports or upgrading the base system only uses around 50% cpu
utilization (measured with the top utility) on my dual core machine. Is
there some way I can get higher cpu usage?

/usr/src/UPDATING says don't use make -j. I tried installing
openoffice.org-2 with make -j 2 but it failed at some stage saying it
couldn't find a directory. It works not using -j.
This was just added to the ports tree as port of Google Summer of Code 
2007.  I don't recall if its was complete.


Lots of people compile the base system with -jX
The sweet spot is typically number of cores + 1

so on a dual dual core computer use -j5

If your disks are slow, they will hold your cpu back.

--
-
Philip M. Gollucci ([EMAIL PROTECTED])
c:323.219.4708 o:703.749.9295x206
Senior System Admin - Riderway, Inc.
http://riderway.com / http://ridecharge.com
1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB  B89E 1324 9B4F EC88 A0BF

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: compile ports and base using both cores

2007-11-07 Thread Erik Cederstrand

Chris Whitehouse wrote:

Chris Whitehouse wrote:

Hi,

Installing ports or upgrading the base system only uses around 50% cpu 
utilization (measured with the top utility) on my dual core machine. 
Is there some way I can get higher cpu usage?


/usr/src/UPDATING says don't use make -j. I tried installing 
openoffice.org-2 with make -j 2 but it failed at some stage saying it 
couldn't find a directory. It works not using -j.


I'm using 7.0-BETA1.5 i386 on an AMD 64 system.

Thanks

Chris


Hi again,

I was wondering if anyone could give me some ideas about this. Btw I 
confess the subject line is not quite right, I think both cores are 
being used but cpu is only around 50% - or it is being measured so that 
it looks like 50% but is really more. If I make buildworld and compile a 
 port at the same time then cpu usage really does go up to 100%


AFAIK, parallel compilation using 'make -j' is not guaranteed to work. 
The concurrent threads might interfere with or depend on each other. If 
it does work for you then great, you saved some time, but don't submit 
PRs before you have tried compiling without the -j option.


Since make without -j runs single-threaded, it will only use one CPU at 
a time. The scheduler may move the process around between CPUs depending 
on which CPU is more idle at any given time. The reason a simultaneous 
make buildworld and port compilation uses 100% CPU is that these are two 
separate processes which do not interfere with one another, so they can 
be run on the two CPUs simultaneously.


Erik
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]