From: tip-bot for Michael Neuling <mikey@neuling.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
mingo@redhat.com, a.p.zijlstra@chello.nl,
benh@kernel.crashing.org, tglx@linutronix.de, mingo@elte.hu,
mikey@neuling.org
Subject: [tip:sched/core] powerpc: Enable asymmetric SMT scheduling on POWER7
Date: Wed, 9 Jun 2010 10:18:20 GMT [thread overview]
Message-ID: <tip-76cbd8a8f8b0dddbff89a6708bd5bd13c0d21a00@git.kernel.org> (raw)
In-Reply-To: <20100608045702.31FB5CC8C7@localhost.localdomain>
Commit-ID: 76cbd8a8f8b0dddbff89a6708bd5bd13c0d21a00
Gitweb: http://git.kernel.org/tip/76cbd8a8f8b0dddbff89a6708bd5bd13c0d21a00
Author: Michael Neuling <mikey@neuling.org>
AuthorDate: Tue, 8 Jun 2010 14:57:02 +1000
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 9 Jun 2010 11:13:14 +0200
powerpc: Enable asymmetric SMT scheduling on POWER7
The POWER7 core has dynamic SMT mode switching which is controlled by
the hypervisor. There are 3 SMT modes:
SMT1 uses thread 0
SMT2 uses threads 0 & 1
SMT4 uses threads 0, 1, 2 & 3
When in any particular SMT mode, all threads have the same performance
as each other (ie. at any moment in time, all threads perform the same).
The SMT mode switching works such that when linux has threads 2 & 3 idle
and 0 & 1 active, it will cede (H_CEDE hypercall) threads 2 and 3 in the
idle loop and the hypervisor will automatically switch to SMT2 for that
core (independent of other cores). The opposite is not true, so if
threads 0 & 1 are idle and 2 & 3 are active, we will stay in SMT4 mode.
Similarly if thread 0 is active and threads 1, 2 & 3 are idle, we'll go
into SMT1 mode.
If we can get the core into a lower SMT mode (SMT1 is best), the threads
will perform better (since they share less core resources). Hence when
we have idle threads, we want them to be the higher ones.
This adds a feature bit for asymmetric packing to powerpc and then
enables it on POWER7.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
LKML-Reference: <20100608045702.31FB5CC8C7@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/powerpc/include/asm/cputable.h | 3 ++-
arch/powerpc/kernel/process.c | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index b0b2113..4b611ca 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -197,6 +197,7 @@ extern const char *powerpc_base_platform;
#define CPU_FTR_SAO LONG_ASM_CONST(0x0020000000000000)
#define CPU_FTR_CP_USE_DCBTZ LONG_ASM_CONST(0x0040000000000000)
#define CPU_FTR_UNALIGNED_LD_STD LONG_ASM_CONST(0x0080000000000000)
+#define CPU_FTR_ASYM_SMT LONG_ASM_CONST(0x0100000000000000)
#ifndef __ASSEMBLY__
@@ -412,7 +413,7 @@ extern const char *powerpc_base_platform;
CPU_FTR_MMCRA | CPU_FTR_SMT | \
CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
- CPU_FTR_DSCR | CPU_FTR_SAO)
+ CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT)
#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 9d255b4..a3f347c 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1268,3 +1268,12 @@ unsigned long randomize_et_dyn(unsigned long base)
return ret;
}
+
+int arch_sd_sibiling_asym_packing(void)
+{
+ if (cpu_has_feature(CPU_FTR_ASYM_SMT)) {
+ printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n");
+ return SD_ASYM_PACKING;
+ }
+ return 0;
+}
next prev parent reply other threads:[~2010-06-09 10:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 4:57 [PATCH 0/3] sched: asymmetrical packing for POWER7 SMT4 Michael Neuling
2010-06-08 4:57 ` [PATCH 1/3] sched: fix capacity calculations for SMT4 Michael Neuling
2010-06-09 10:14 ` [tip:sched/core] sched: Fix " tip-bot for Srivatsa Vaddagiri
2010-06-09 23:03 ` Michael Neuling
2010-06-10 2:06 ` [PATCH] sched: update comments to make docbook happy Michael Neuling
2010-06-18 10:19 ` [tip:sched/core] sched: Fix comments to make them DocBook happy tip-bot for Michael Neuling
2010-06-10 6:48 ` [tip:sched/core] sched: Fix capacity calculations for SMT4 Peter Zijlstra
2010-06-17 23:04 ` Michael Neuling
2010-06-18 10:18 ` [tip:sched/core] sched: Fix fix_small_capacity tip-bot for Michael Neuling
2010-06-08 4:57 ` [PATCH 3/3] powerpc: enabled asymmetric SMT scheduling on POWER7 Michael Neuling
2010-06-09 8:54 ` Benjamin Herrenschmidt
2010-06-09 10:18 ` tip-bot for Michael Neuling [this message]
2010-06-09 14:27 ` [tip:sched/core] powerpc: Exclude arch_sd_sibiling_asym_packing() on UP tip-bot for Peter Zijlstra
2010-06-09 14:33 ` tip-bot for Peter Zijlstra
2010-06-08 4:57 ` [PATCH 2/3] sched: add asymmetric group packing option for sibling domain Michael Neuling
2010-06-09 10:14 ` [tip:sched/core] sched: Add " tip-bot for Michael Neuling
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=tip-76cbd8a8f8b0dddbff89a6708bd5bd13c0d21a00@git.kernel.org \
--to=mikey@neuling.org \
--cc=a.p.zijlstra@chello.nl \
--cc=benh@kernel.crashing.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox