From owner-freebsd-arch@FreeBSD.ORG Fri Mar 6 20:48:00 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F368B96; Fri, 6 Mar 2015 20:48:00 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69106F6E; Fri, 6 Mar 2015 20:48:00 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3289BB915; Fri, 6 Mar 2015 15:47:56 -0500 (EST) From: John Baldwin To: freebsd-arch@freebsd.org Subject: RFC: Simplfying hyperthreading distinctions Date: Fri, 06 Mar 2015 15:44:06 -0500 Message-ID: <1640664.8z9mx3EOQs@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 06 Mar 2015 15:47:56 -0500 (EST) Cc: 'Andriy Gapon' X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 20:48:00 -0000 Currently we go out of our way a bit to distinguish Pentium4-era hyperthreading from more recent ("modern") hyperthreading. I suspect that this distinction probably results in confusion more than anything else. Intel's documentation does not make near as broad a distinction as far as I can tell. Both types of SMT are called hyperthreading in the SDM for example. However, we have the astonishing behavior that 'machdep.hyperthreading_allowed' only affects "old" hyperthreads, but not "new" ones. We also try to be overly cute in our dmesg output by using HTT for "old" hyperthreading, and SMT for "new" hyperthreading. I propose the following changes to simplify things a bit: 1) Call both "old" and "new" hyperthreading HTT in dmesg. 2) Change machdep.hyperthreading_allowed to apply to both new and old HTT. However, doing this means a POLA violation in that we would now disable modern HTT by default. Balanced against re-enabling "old" HTT by default on an increasingly-shrinking pool of old hardware, I think the better approach here would be to also change the default to allow HTT. 3) Possibly add a different knob (or change the behavior of machdep.hyperthreading_allowed) to still bring up hyperthreads, but leave them out of the default cpuset (set 1). This would allow those threads to be re-enabled dynamically at runtime by adjusting the mask on set 1. The original htt settings back when 'hyperthreading_allowed' was introduced actually permitted this via by adjusting 'machdep.hlt_cpus' at runtime. What do people think? -- John Baldwin