From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 4 18:47:17 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 DEA7C16A4BF for ; Sat, 4 Oct 2003 18:47:17 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 90E8C43F75 for ; Sat, 4 Oct 2003 18:47:16 -0700 (PDT) (envelope-from mdcki@gmx.net) Received: (qmail 30489 invoked by uid 65534); 5 Oct 2003 01:47:15 -0000 Received: from cvpn009.gwdg.de (EHLO gmx.net) (134.76.22.9) by mail.gmx.net (mp016) with SMTP; 05 Oct 2003 03:47:15 +0200 X-Authenticated: #17236065 Message-ID: <3F7F7838.4070707@gmx.net> Date: Sun, 05 Oct 2003 03:47:36 +0200 From: Marcin Dalecki User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5b) Gecko/20030911 X-Accept-Language: en-us, en MIME-Version: 1.0 To: richardcoleman@mindspring.com References: <20031004190251.GA60026@rot13.obsecurity.org> <3F7F1D63.2010703@mindspring.com> <20031004200435.GA60432@rot13.obsecurity.org> <3F7F41A5.7020202@mindspring.com> In-Reply-To: <3F7F41A5.7020202@mindspring.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: Mikulas Patocka cc: Kris Kennaway 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 01:47:18 -0000 Richard Coleman wrote: > 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. >> >> Kris > > > Sigh. No one is claiming HTT is magic performance beans. The 50% > slowdown I'm talking about is between -j1 and -j2 BOTH ARE WHICH ARE > USING HTT. > > It's just an interesting observation. That's all. It's not interresting. It is to be expected. The only gains one could exepect are in the case where sufficently differrent execution units of the CPU would be used. Like for example doing floating point vers. integer calculations. But exen then Amdahl will bite you by the incurrend synchronisation verhead anyway..