Subject: Re: so why doesn't 'cc -pipe' create any noticable parallelism on SMP machines?
To: NetBSD Kernel Technical Discussion List <tech-kern@NetBSD.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 04/11/2005 21:39:30
On Mon, Apr 11, 2005 at 12:27:36AM -0400, Greg A. Woods wrote:
> So as I sit here staring at my "build.sh -u" run with "CFLAGS+=-pipe" on
> my dual-CPU alpha I'm wondering why I don't usually see any more than
> one CPU fully utilized, and that's including with two xterms (one for
> the scrolling build output) and "systat -w 1 vm" running on the machine
> as well.  (this is with a 1.6.x kernel on the build machine)
> 
> In fact I rarely ever see more than one runnable process, and the times
> I do can, I believe, easily be attributed to xterm and systat overhead.

My guess is that the CPU-bound task is cc1. All others are just waiting
on cc1.

> 
> Now I know that the compiler doesn't start spitting out object code
> right away, and cpp isn't really that much of a CPU pig, but I really
> did always assume that "-pipe" would be more than just window dressing,
> and indeed it seemed to improve overall build performance on
> uniprocessor machines, at last after the new pipe implementation was
> first introduced.

Because with page loaning it would avoid kernel/userland copies, which, I
guess, happens when you use a temp file (even if the file is in a MFS).

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--