Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 25 Oct 2002 20:22:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 25 Oct 2002 20:22:08 -0400 Received: from momus.sc.intel.com ([143.183.152.8]:56557 "EHLO momus.sc.intel.com") by vger.kernel.org with ESMTP id ; Fri, 25 Oct 2002 20:22:05 -0400 Message-ID: From: "Nakajima, Jun" To: Dave Jones , Jeff Garzik Cc: Robert Love , "Nakajima, Jun" , Alan Cox , "'akpm@digeo.com'" , "'linux-kernel@vger.kernel.org'" , "'chrisl@vmware.com'" , "'Martin J. Bligh'" Subject: RE: [PATCH] hyper-threading information in /proc/cpuinfo Date: Fri, 25 Oct 2002 17:26:11 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1869 Lines: 51 Agree. We can calculate smp_num_siblings from phys_proc_id[n] as the kernel does, although it would be just nice or double-checking (but if the application cannot calculate it correctly how can one expect it runs fine? I mean it's very easy.) So this is sufficient: +#ifdef CONFIG_SMP + if (cpu_has_ht) { + seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); + } +#endif For a multi-core system, one could do: seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]); seq_printf(m, "core id\t: %d\n", core_id[n]); This would support multiple SMT processor cores on one chip. "core_id" is the id of the CPU core in a chip die that the processor belongs to. "physical_proc_id" is the id of the CPU die in the system. Jun -----Original Message----- From: Dave Jones [mailto:davej@codemonkey.org.uk] Sent: Friday, October 25, 2002 5:13 PM To: Jeff Garzik Cc: Robert Love; Nakajima, Jun; Alan Cox; 'akpm@digeo.com'; 'linux-kernel@vger.kernel.org'; 'chrisl@vmware.com'; 'Martin J. Bligh' Subject: Re: [PATCH] hyper-threading information in /proc/cpuinfo On Fri, Oct 25, 2002 at 08:04:45PM -0400, Jeff Garzik wrote: > Not really... we print out other information that is duplicated N times, > because it is the common case that N-way systems have matched processors > with matched capabilities. Not really. We print out the 'duplicate' info because it's read that way from different CPUs. The smp_num_siblings is a single global variable. Theoretically, the other stuff /could/ change in an asymetrical system, but the num_siblings thing is constant. Dave -- | Dave Jones. http://www.codemonkey.org.uk - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/