From owner-freebsd-current Fri Jan 31 13:10:30 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 151AB37B401 for ; Fri, 31 Jan 2003 13:10:29 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6876B43FB1 for ; Fri, 31 Jan 2003 13:10:28 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id h0VLACri098683; Fri, 31 Jan 2003 15:10:12 -0600 (CST) (envelope-from dan) Date: Fri, 31 Jan 2003 15:10:12 -0600 From: Dan Nelson To: Don Bowman Cc: "'Matthew Dillon'" , Peter Wemm , Bosko Milekic , "Daniel C. Sobral" , Trish Lynch , freebsd-current@FreeBSD.ORG Subject: Re: Hyperthreading and machdep.cpu_idle_hlt Message-ID: <20030131211012.GD3671@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.3i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Jan 31), Don Bowman said: > Thus the worst thing you could have would be a nop-loop with > no stalls, which would squeeze the other to death. I don't think this is possible, from looking at Intel's white papers. > In practise I've found intel's numbers to be true, that the SMT gives > you a ~20% boost, implying that there is nowhere close to a 50-50% > split in normal use. According to "Hyper-Threading Technology Architecture and Microarchitecture" at http://developer.intel.com/technology/itj/2002/volume06issue01/art01_hyper/vol6iss1_art01.pdf , the internal schedulers make no distinction between the two logical CPUs, and "To avoid deadlock and ensure fairness, there is a limit on the number of active entries that a logical processor can have in each scheduler's queue." That sounds like given identical processes running on both logical CPUs, you will get a 50-50% balance. I think for HT to be any help, FreeBSD's scheduler needs to know which pairs of CPUs share resources, so it can schedule one process per pair first, and any remaining runnable processes get put on the remaining CPUs, possibly allocated so threads belonging to the same process run on the same pair. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message