From: Xu, A. <anh...@in...> - 2011-12-13 09:04:03
|
Ignore my verbose explanation, there are bugs in functions map_cpuid_pkgid. This function may lack of consideration for complex CPU topologies. Nothing wrong with kernel sys interface. I can provide an CPU topology instance that illustrate this bug. See the attachment, if we had a cpu topology like correct_mappings.png and function map_cpuid_pkgid can generate a cpu topology like in wrong_mappings.png according to correct_mappings.png ( in each picture, 'physical package' depicted as blue circle, 'core' depicted as purple circle, 'logic CPU' depicted as red circle. The digit in circles are their respective 'id' ) -----Original Message----- From: Garrett Cooper [mailto:yan...@gm...] Sent: Tuesday, December 13, 2011 2:32 PM To: Xu, Anhua Cc: ltp...@li...; Song, Youquan Subject: Re: [Ltp-commits] [patch] Power Management: Fix CPUs' mapping in map_cpuid_pkgid On Thu, Dec 1, 2011 at 9:20 PM, Xu, Anhua <anh...@in...> wrote: > >From fcf9dc401bcb91b8691da57173ff06f22eb647af Mon Sep 17 00:00:00 2001 > From: Xu,Anhua <anh...@in...> > Date: Mon, 28 Nov 2011 22:03:38 +0800 > Subject: [PATCH] Power Management: Fix algorithm in map_cpuid_pkgid > > Function map_cpuid_pkgid failed to map CPUs in a 12 cores (2 physical > sockets, each contains a 6-core package, totally 24 logic CPUs > considering hyperthreading) x86-64 machine and indicates 18 logic CPUs > in one package and the other 6 logic CPUS in another package. Whereas > in fact each package contains 12 logic CPUs (6 cores). The map structures > generated from map_cpuid_pkgid() are obviously confict with info found in > /sys/devices/system/cpu/cpu#/topology/physical_package_id Wouldn't the bug be in how the information is reported via the Linux kernel and not the test program then? Thanks, -Garrett |