From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 10 16:02:09 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BE9518C for ; Tue, 10 Mar 2015 16:02:09 +0000 (UTC) Received: from mail-yk0-x235.google.com (mail-yk0-x235.google.com [IPv6:2607:f8b0:4002:c07::235]) (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 31D04358 for ; Tue, 10 Mar 2015 16:02:09 +0000 (UTC) Received: by yks20 with SMTP id 20so1172879yks.4 for ; Tue, 10 Mar 2015 09:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9m5WL0DMafaOtVHZUxPn99rpjut/2mbQH0RiHqANHE0=; b=IBzDnQSWWZVz9vvunUh6GlsvVhQPZWoXdN+hYYvJbqM9bv899q7pcruLviABmUaIUb QInZSmoG7xZiLkLFQvBjBSB+x7hOhlmeUKSAgd3KpTyTRIOeu3kZ4DjiGf9qkTDVPUdP 4hgzSE+14XtiaXO2wtuT3OeI0KxjLaG98BTRDVv62ZstqW/U4ohH9wdztTPWFYLXGhEu k7YYxkYIfdtLBtOqCsv5WrDj3rX4dQoejeQFqPcsUGmiwuqWw3zpAI/MQ9PYe3ShA2Lk tf3Adi/gBxWI4nJ2pRlxNacStjABAPFVePbfis5jDc3K7Ins9rBx8HulTtreH3G+DYXM Jytg== MIME-Version: 1.0 X-Received: by 10.170.220.197 with SMTP id m188mr36861684ykf.58.1426003328339; Tue, 10 Mar 2015 09:02:08 -0700 (PDT) Received: by 10.170.79.87 with HTTP; Tue, 10 Mar 2015 09:02:08 -0700 (PDT) In-Reply-To: References: <9F2E1411-B517-4BC8-AF61-BB15EE35083C@me.com> <54FF1343.1020705@gmx.de> Date: Tue, 10 Mar 2015 09:02:08 -0700 Message-ID: Subject: Re: detecting hyperthreading From: Freddie Cash To: "Pokala, Ravi" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-hackers@freebsd.org" , "lokadamus@gmx.de" , 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: Tue, 10 Mar 2015 16:02:09 -0000 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 =3D "GenuineIntel" Id =3D 0xf29 Family =3D 0xf Model =3D 0x2 > >Stepping =3D 9 > > > >Features=3D0xbfebfbff >CA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > > Features2=3D0x4400 > > 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. > =E2=80=8B6 lines or so below the Features line shows the kernel loading "cp= u0 (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)".=E2=80=8B --=20 Freddie Cash fjwcash@gmail.com