From owner-freebsd-arch@FreeBSD.ORG Sat Mar 7 02:14:09 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 BA5F46BF; Sat, 7 Mar 2015 02:14:09 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 856787A6; Sat, 7 Mar 2015 02:14:09 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t272E1M3030345 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 6 Mar 2015 18:14:02 -0800 Message-ID: <54FA5EE9.4090305@freebsd.org> Date: Fri, 06 Mar 2015 18:14:01 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: John Baldwin , freebsd-arch@freebsd.org Subject: Re: RFC: Simplfying hyperthreading distinctions References: <1640664.8z9mx3EOQs@ralph.baldwin.cx> In-Reply-To: <1640664.8z9mx3EOQs@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZCe8u/SDzcYNWz1twsPF9nWYp8mFS4hlveMjaYdazIu/VoLZatzaVCQhm6PJtvKoLhRdysuwsD680Iggr8eYg9+wWNraEnL2g= X-Sonic-ID: C;0u0rn2/E5BGBrO8Jj30JFw== M;sHVcn2/E5BGBrO8Jj30JFw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd 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: Sat, 07 Mar 2015 02:14:09 -0000 On 03/06/15 12:44, John Baldwin wrote: > 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? I'm fine with whatever naming, but if we're making new sysctls, especially for the cpuset case, is there a reason to hide the behavior under machdep? We support at least three non-x86 CPUs with SMT (POWER8, Cell, and POWER5) and the relevant scheduling logic should be MI. At least POWER8 supports 8 threads per core, so you might also want more granularity than just "on" or "off". -Nathan