From: Paul C. <pc...@us...> - 2015-01-08 13:45:21
|
On 12/22/2014 10:31 AM, Mamatha Inamdar wrote: > Problem: ppc64_cpu --threads-per-core gives wrong data when --smt value set > > This patch will resolve the above issue and display the correct values of threads-per-core > for the ppc64_cpu command when --smt value is set. > > I have used the following equation to calculate threads_per_core as per lscpu command. > > threads_per_core = nthreads / ncores > > *********************************************** > Test results: > > CASE 1: > > ./src/ppc64_cpu --smt=on > [root@llmjuno03b powerpc-utils]# ./src/ppc64_cpu --threads-per-core > Threads per core: 4 > > lscpu output: > Thread(s) per core: 4 > ------------------------------------------ > CASE 2: > > ./src/ppc64_cpu --smt=2 > [root@llmjuno03b powerpc-utils]# ./src/ppc64_cpu --threads-per-core > Threads per core: 2 > > lscpu output: > Thread(s) per core: 2 > -------------------------------------------------- > CASE 3: > > ./src/ppc64_cpu --smt=1 > [root@llmjuno03b powerpc-utils]# ./src/ppc64_cpu --threads-per-core > Threads per core: 1 > > lscpu output: > Thread(s) per core: 1 > ------------------------------------------------- I don't think the purpose of "--threads-per-core" is simply to duplicate the function of "--smt". It's to report the number of hardware threads per core, regardless of online/offline. The ppc64_cpu command has no other way to report "what's the maximum SMT mode"? In addition, this patch just calculates the total number of online threads and divides by the number of CPUs in the system, which 1. doesn't account for cores that are offline 2. doesn't account for scenarios in which different cores may be in different SMT modes, although this is not handled well by the command in general PC |