From owner-freebsd-questions@FreeBSD.ORG Thu Nov 8 07:01:59 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3BC816A418 for ; Thu, 8 Nov 2007 07:01:59 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from mail.itu.dk (pluto.itu.dk [130.226.142.18]) by mx1.freebsd.org (Postfix) with ESMTP id 5055B13C4A8 for ; Thu, 8 Nov 2007 07:01:59 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from localhost (unknown [10.0.0.3]) by mail.itu.dk (Postfix) with ESMTP id B9E4236EE3A; Thu, 8 Nov 2007 08:01:47 +0100 (CET) X-Virus-Scanned: amavisd-new at itu.dk Received: from superman.itu.dk ([130.226.142.5]) by localhost (daredevil.itu.dk [130.226.142.26]) (amavisd-new, port 10024) with ESMTP id dO1AXEQmOKgG; Thu, 8 Nov 2007 08:01:44 +0100 (CET) Received: from [192.168.1.149] (stud1-15.itu.dk [130.226.140.15]) by superman.itu.dk (Postfix) with ESMTP id 21D939E418; Thu, 8 Nov 2007 08:01:40 +0100 (CET) Message-ID: <4732B45C.9000709@cederstrand.dk> Date: Thu, 08 Nov 2007 08:01:48 +0100 From: Erik Cederstrand User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Chris Whitehouse References: <472CB105.9020302@onetel.com> <47325A12.5060803@onetel.com> In-Reply-To: <47325A12.5060803@onetel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: compile ports and base using both cores X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2007 07:01:59 -0000 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