From owner-cvs-src@FreeBSD.ORG Mon Oct 17 19:14:54 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3650016A421; Mon, 17 Oct 2005 19:14:54 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F7FC43D48; Mon, 17 Oct 2005 19:14:53 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id j9HJMeXF081827; Mon, 17 Oct 2005 15:22:40 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: obrien@FreeBSD.org Date: Mon, 17 Oct 2005 15:14:37 -0400 User-Agent: KMail/1.6.2 References: <200510160858.j9G8wR9v045670@repoman.freebsd.org> <200510171430.46431.jkim@FreeBSD.org> <20051017185024.GB97488@dragon.NUXI.org> In-Reply-To: <20051017185024.GB97488@dragon.NUXI.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="euc-kr" Content-Transfer-Encoding: 7bit Message-Id: <200510171514.39881.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV devel-20050919/1139/Sun Oct 16 20:30:04 2005 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/amd64/amd64 identcpu.c src/sys/i386/i386 identcpu.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 19:14:54 -0000 On Monday 17 October 2005 02:50 pm, David O'Brien wrote: > On Mon, Oct 17, 2005 at 02:30:40PM -0400, Jung-uk Kim wrote: > > Just for the people who still don't understand: > > > > Physical/Logical cores: 1/2 -> single core with HTT > > Physical/Logical cores: 2/2 -> dual core without HTT > > Physical/Logical cores: 2/4 -> dual core with HTT > > > > BTW, I just committed the following because this commit broke it: > > http://docs.freebsd.org/cgi/mid.cgi?200510171551.j9HFpSRY074364 > > > > Now the per-CPU information is like this: > > > > Logical cores: 2 -> single core with HTT > > Physical cores: 2 -> dual core without HTT > > This is the AMD case - this is what I [tried to] fixed. > The correct output for my system is "Physical cores: 4". Wrong. That's not per-CPU information. > This is also given by: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > > so what additional information is being given to the user? Because users want to know whether they are using two dual-core CPUs or four CPUs. It is NOT redundant information. > A 1P/2C Athlon64 X2 system is identical to a 2P/1C Athlon-MP > system. It is purely SMP and there is no preference to scheduling > on either core. And one gets full performance by scheduling on both > cores at the same time. Sigh... No, they are NOT the same. 2P/1C can be configured as ccNUMA. 1P/2C cannot, i.e., they share the memory controller. > > Physical cores: 2 -> dual core with HTT (two lines) > > Logical cores: 4 > > This is the Intel case - my commit does not touch this. > > > > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > > > cpu0 (BSP): APIC ID: 0 > > > cpu1 (AP): APIC ID: 1 > > > cpu2 (AP): APIC ID: 2 > > > cpu3 (AP): APIC ID: 3 > > > > This is NOT per-CPU info. > > Please explain what you are trying to achive. AMD sets CPUID.HTT > solely for the benfit of licensing issues of Microsoft products and > Red Hat. The FreeBSD license does not restrict the number of CPU's > one can use. The FreeBSD kernel should pretend CPUID.HTT isn't set. What I am trying to achive is simple: I want to know how many physical and/or logical cores I have in one CPU package. It has nothing to do with Hyper-Threading in fact. > In fact some Opteron BIOS's cause CPUID.HTT to not be set when > using dual-core CPU's. That's broken BIOS by the spec. AMD64 Architecture Programmer's Manual Volume 3: General-Purpose and System Instructions: http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf Logical Processor Count, Page 122: 'If the value of the CMP legacy bit is 1, then the value of the HTT bit indicates the presence of multiple cores per package and the value of the logical processor count field indicates the number of cores per package.' Jung-uk Kim