All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@linux.vnet.ibm.com>
To: Nathan Lynch <ntl@pobox.com>
Cc: linuxppc-dev@ozlabs.org, Ingo Molnar <mingo@elte.hu>,
	Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org, Anton Blanchard <anton@samba.org>
Subject: Re: [RFC/PATCH 0/3] sched: allow arch override of cpu power
Date: Thu, 26 Jun 2008 16:49:32 -0300	[thread overview]
Message-ID: <4863F2CC.1030907@linux.vnet.ibm.com> (raw)
In-Reply-To: <1213835374-10868-1-git-send-email-ntl@pobox.com>

Hi Nathan,

Nathan Lynch wrote:
> There is an "interesting" quality of POWER6 cores, which each have 2
> hardware threads: assuming one thread on the core is idle, the primary
> thread is a little "faster" than the secondary thread.  To illustrate:
>   
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

WARNING: multiple messages have this Message-ID (diff)
From: Breno Leitao <leitao@linux.vnet.ibm.com>
To: Nathan Lynch <ntl@pobox.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	Anton Blanchard <anton@samba.org>
Subject: Re: [RFC/PATCH 0/3] sched: allow arch override of cpu power
Date: Thu, 26 Jun 2008 16:49:32 -0300	[thread overview]
Message-ID: <4863F2CC.1030907@linux.vnet.ibm.com> (raw)
In-Reply-To: <1213835374-10868-1-git-send-email-ntl@pobox.com>

Hi Nathan,

Nathan Lynch wrote:
> There is an "interesting" quality of POWER6 cores, which each have 2
> hardware threads: assuming one thread on the core is idle, the primary
> thread is a little "faster" than the secondary thread.  To illustrate:
>   
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


  parent reply	other threads:[~2008-06-26 19:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19  0:29 [RFC/PATCH 0/3] sched: allow arch override of cpu power Nathan Lynch
2008-06-19  0:29 ` Nathan Lynch
2008-06-19  0:29 ` [RFC/PATCH 1/3] sched: support arch override of sched_group " Nathan Lynch
2008-06-19  0:29   ` Nathan Lynch
2008-06-19  0:29 ` [RFC/PATCH 2/3] add cpu_power to machdep_calls, override SD_SIBLING_INIT Nathan Lynch
2008-06-19  0:29   ` Nathan Lynch
2008-06-19  0:29 ` [RFC/PATCH 3/3] adjust cpu power for secondary threads on POWER6 Nathan Lynch
2008-06-19  0:29   ` Nathan Lynch
2008-06-19  2:58   ` Olof Johansson
2008-06-19  2:58     ` Olof Johansson
2008-06-19  3:03     ` Olof Johansson
2008-06-19  3:03       ` Olof Johansson
2008-06-19  9:50 ` [RFC/PATCH 0/3] sched: allow arch override of cpu power Ingo Molnar
2008-06-19  9:50   ` Ingo Molnar
2008-06-19 17:09   ` Nathan Lynch
2008-06-19 17:09     ` Nathan Lynch
2008-06-26 19:49 ` Breno Leitao [this message]
2008-06-26 19:49   ` Breno Leitao
2008-06-27 14:23   ` Nathan Lynch
2008-06-27 14:23     ` Nathan Lynch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4863F2CC.1030907@linux.vnet.ibm.com \
    --to=leitao@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=ntl@pobox.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.