Re: [RFC/PATCH 0/3] sched: allow arch override of cpu power

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Breno Leitao
Date: Thursday, June 26, 2008 - 12:49 pm

Hi Nathan,

Nathan Lynch wrote:
I found this feature interesting and decided to do some tests.
After some tests I found that the example you post really runs fast in 
the first CPU, but a more "elaborated" application runs slower on the 
first CPU.
Here is a small example:

# taskset 0x1 time -f "%e,  %U, %S" ./a.out ; taskset 0x2 time -f "%e, 
%U, %S" ./a.out
10.77,  10.72, 0.01
10.53, 10.48, 0.01

# taskset 0x2 time -f "%e,  %U, %S" ./a.out ; taskset 0x1 time -f "%e, 
%U, %S" ./a.out
10.55,  10.50, 0.01
10.77, 10.72, 0.01

# cat calc.c
#include <stdio.h>

int main(){
    int j = 0;
    float i = 42;
   
    srand(123);
    while (j++ < 100000000){
        i = i*i + i;
        i = i/2 + random(2);
    }

    printf("%d\n", i);
    return 0;
}
# cat /proc/cpuinfo
processor    : 0
cpu        : POWER6 (architected), altivec supported
clock        : 5000.001000MHz
revision    : 3.2 (pvr 003e 0302)

processor    : 1
cpu        : POWER6 (architected), altivec supported
clock        : 5000.001000MHz
revision    : 3.2 (pvr 003e 0302)
...

Note that the IRQ are balanced among the 8 CPUs, and the machine is idle.
Do you know why I get this difference? Something wrong with the test?

Thanks

- 
Breno Leitao
Linux Technology Center Brazil
Phone: +55-16-8115-3915 (T/L: 839-1293)
leitao@linux.vnet.ibm.com

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC/PATCH 0/3] sched: allow arch override of cpu power, Nathan Lynch, (Wed Jun 18, 5:29 pm)
Re: [RFC/PATCH 0/3] sched: allow arch override of cpu power, Breno Leitao, (Thu Jun 26, 12:49 pm)