From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 5 05:31:54 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FE5216A4B3 for ; Sun, 5 Oct 2003 05:31:54 -0700 (PDT) Received: from freebie.xs4all.nl (freebie.xs4all.nl [213.84.32.253]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC54643FE3 for ; Sun, 5 Oct 2003 05:31:52 -0700 (PDT) (envelope-from wkb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (localhost [127.0.0.1]) by freebie.xs4all.nl (8.12.9p1/8.12.9) with ESMTP id h95CVoZ8011321; Sun, 5 Oct 2003 14:31:50 +0200 (CEST) (envelope-from wkb@freebie.xs4all.nl) Received: (from wkb@localhost) by freebie.xs4all.nl (8.12.9p1/8.12.9/Submit) id h95CVnNb011320; Sun, 5 Oct 2003 14:31:49 +0200 (CEST) (envelope-from wkb) Date: Sun, 5 Oct 2003 14:31:49 +0200 From: Wilko Bulte To: Kris Kennaway Message-ID: <20031005123149.GB11276@freebie.xs4all.nl> References: <20031004190251.GA60026@rot13.obsecurity.org> <3F7F1D63.2010703@mindspring.com> <20031004200435.GA60432@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031004200435.GA60432@rot13.obsecurity.org> User-Agent: Mutt/1.4.1i X-OS: FreeBSD 4.9-PRERELEASE X-PGP: finger wilko@freebsd.org cc: Richard Coleman cc: Mikulas Patocka cc: freebsd-hackers@freebsd.org Subject: Re: Hyperthreading slowdown X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Oct 2003 12:31:54 -0000 On Sat, Oct 04, 2003 at 01:04:35PM -0700, Kris Kennaway wrote: > On Sat, Oct 04, 2003 at 03:20:03PM -0400, Richard Coleman wrote: > > Kris Kennaway wrote: > > >On Sat, Oct 04, 2003 at 04:39:03PM +0200, Mikulas Patocka wrote: > > >>I installed FreeBSD 4.9RC1 on P4 3GHz with hyperthreading and I see > > >>drastic slowdown when kernel with hyperthreading is booted. For example > > >>program compilation took this time: > > >> > > >>hyperthreading kernel, make -j 1 --- 1:09 > > >>hyperthreading kernel, make -j 2 --- 0:42 > > >>singlethreading kernel, make -j 1 --- 0:45 > > >>singlethreading kernel, make -j 2 --- 0:41 > > >> > > >>Compilation does very few system calls so when I compile with only one > > >>process (-j 1), it should be as fast as with singlethreading kernel. Do > > >>you have any idea why is it so slow? > > > > > >Do you realise that hyperthreading != a secret extra CPU in your system? > > > > > >Kris > > > > I didn't see anywhere in the message where he implied that. To me, the > > interesting thing is that there is such a larger difference between the > > compile time for -j1 and -j2 when using hyperthreading as compared to > > the difference between -j1 and -j2 for a single threaded kernel. It's > > over a 50% slowdown. > > Yes, that's because (as discussed in the archives) the kernel treats > it like an extra, completely decoupled physical CPU and schedules > processes on it without further consideration. This is presumably the > cause of the slowdown, because it's only efficient to use the virtual > CPU under certain workload patterns. HTT is not magic performance > beans. Right. And in addition it makes the system considerably more power hungry.. I measured both with and without SMP on my P4/2.4G HTT CPU. -- | / o / /_ _ wilko@FreeBSD.org |/|/ / / /( (_) Bulte