From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 4 19:55: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 A587716A4B3 for ; Sat, 4 Oct 2003 19:55:17 -0700 (PDT) Received: from artax.karlin.mff.cuni.cz (artax.karlin.mff.cuni.cz [195.113.31.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id E76B543FE5 for ; Sat, 4 Oct 2003 19:55:16 -0700 (PDT) (envelope-from mikulas@artax.karlin.mff.cuni.cz) Received: by artax.karlin.mff.cuni.cz (Postfix, from userid 17421) id 075F33FAA; Sun, 5 Oct 2003 04:55:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by artax.karlin.mff.cuni.cz (Postfix) with ESMTP id EEEFB2FBD9; Sun, 5 Oct 2003 04:55:14 +0200 (CEST) Date: Sun, 5 Oct 2003 04:55:14 +0200 (CEST) From: Mikulas Patocka To: Ian Dowse In-Reply-To: <200310042256.aa22200@salmon.maths.tcd.ie> Message-ID: References: <200310042256.aa22200@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Richard Coleman cc: freebsd-hackers@freebsd.org 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 02:55:17 -0000 > In message <20031004200435.GA60432@rot13.obsecurity.org>, Kris Kennaway writes: > >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. > > Try also setting the sysctl variable "machdep.cpu_idle_hlt" to 1, as > it doesn't help to have the idle logical CPUs spinning. I did and it solved the problem (-j1 is as fast on hyperthreading kernel as on singlethreading kernel). It should be default setting on hyperthreading system (or at least there should be comment around option HTT that people must set it), because otherwise performance is really terrible --- the idle thread is spinning, taking half of the CPU. Mikulas