From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 11 08:56:03 2015 Return-Path: Delivered-To: freebsd-hackers@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 10CA0DB1; Wed, 11 Mar 2015 08:56:03 +0000 (UTC) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E4A98DC; Wed, 11 Mar 2015 08:56:02 +0000 (UTC) Received: by wevk48 with SMTP id k48so7541437wev.5; Wed, 11 Mar 2015 01:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-type:content-transfer-encoding; bh=OQejqQqLTS1CwY4Foo0mudpcKR+8/ZNzpDo9aJnL/rI=; b=JWIAlOwUQLkGMJXau0Pa4b8JqdnucgYSYOwl7ZIeFvwb7U8ZImkynOFAe6RAALOh3F hIb/xFnmV3VBiB/xGbIjsTJ24TqyuluTOqoyUlPCFXxxzwOrKOoFvFBGnVpIWjExcBoy wAplIqxxhFEeRiSXLCq750ED4IOAdD+CN5PyE/JsN93OdSBaGO6Avn1ItKnLxCkpvbyf Dv+jbUn6UDHKbPwt+UpIsqXhxEK8GnDID8CHfIec3htzD+02irtbOdY0k3/S7MyFpmd1 4qhcEL3kVF/9y8tbgnmmFCfZJ6OjGlGqboEon0cFurgcZFxKQJptdLW6tuy468E+PV/d IxSg== X-Received: by 10.181.8.75 with SMTP id di11mr120788107wid.26.1426064160989; Wed, 11 Mar 2015 01:56:00 -0700 (PDT) Received: from ernst.home (p578E137B.dip0.t-ipconnect.de. [87.142.19.123]) by mx.google.com with ESMTPSA id gd6sm5536035wib.17.2015.03.11.01.55.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 01:56:00 -0700 (PDT) Date: Wed, 11 Mar 2015 09:55:56 +0100 From: Gary Jennejohn To: Alan Somers Subject: Re: detecting hyperthreading Message-ID: <20150311095556.1ed29f5d@ernst.home> In-Reply-To: References: <9F2E1411-B517-4BC8-AF61-BB15EE35083C@me.com> <54FF1343.1020705@gmx.de> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-hackers@freebsd.org" , "lokadamus@gmx.de" , "Pokala, Ravi" , Rui Paulo X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 08:56:03 -0000 On Tue, 10 Mar 2015 10:07:19 -0600 Alan Somers wrote: > On Tue, Mar 10, 2015 at 10:02 AM, Freddie Cash wrote: > > On Tue, Mar 10, 2015 at 8:56 AM, Pokala, Ravi wrote: > > > >> -----Original Message----- > >> From: "lokadamus@gmx.de" > >> Date: 2015-03-10, Tuesday at 08:52 > >> To: Ravi Pokala , Rui Paulo > >> Cc: "freebsd-hackers@freebsd.org" > >> Subject: Re: detecting hyperthreading > >> > >> >Have you look at dmesg? > >> >My system is a P4 with HTT. > >> >dmesg |more > >> [...] > >> >CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (3000.00-MHz 686-class CPU) > >> > Origin = "GenuineIntel" Id = 0xf29 Family = 0xf Model = 0x2 > >> >Stepping = 9 > >> > > >> >Features=0xbfebfbff >> >CA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > >> > Features2=0x4400 > >> > >> Of course. :-) > >> > >> But there are two problems: > >> > >> (1) That just tells me HTT is supported by the CPU, not that if kernel is > >> using it. > >> (2) It's difficult to parse. > >> > >> Of the two, (1) is the bigger concern for my use-case. > >> > > > > 6 lines or so below the Features line shows the kernel loading "cpu0 > > (BSP)", and then "cpu1 (AP/HT)". > > > > Compare that to a system without HTT, where any extra cpus only show "(AP)". > > > > It's not perfect, but one could grep through /var/run/dmesg.boot looking > > for "cpu" lines and checking for "(AP)" or "(AP/HT)". > > > > -- > > Freddie Cash > > fjwcash@gmail.com > > I always look at "sysctl kern.sched.topology_spec" to tell if > hyperthreading is enabled. It's overkill, but it works. > [snip Ruby] Is this ULE-specific? This OID isn't present on my box using the BSD scheduler. Something to be aware of. -- Gary Jennejohn