From: Michael Neuling <hidden> Date: 2015-10-28 04:54:24
This adds a function to copy the mm->context to the paca. This is
only a basic conversion for now but will be used more extensively in
the next patch.
This also adds #ifdef CONFIG_PPC_BOOK3S around this code since it's
not used elsewhere.
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/include/asm/paca.h | 11 +++++++++++
arch/powerpc/kernel/asm-offsets.c | 2 ++
arch/powerpc/mm/hash_utils_64.c | 5 +++--
arch/powerpc/mm/slb.c | 2 +-
arch/powerpc/mm/slice.c | 3 +--
5 files changed, 18 insertions(+), 5 deletions(-)
From: Michael Neuling <hidden> Date: 2015-10-28 04:54:25
Currently we copy the whole mm_context_t to the paca but only access a
few bits of it. This is wasteful of space paca and also takes quite
some time in the hot path of context switching.
This patch pulls in only the required bits from the mm_context_t to
the paca and on context switch, copies only those.
Benchmarking this (On top of Anton's recent MSR context switching
changes [1]) using processes and yield shows an improvement of almost
3% on POWER8:
http://ozlabs.org/~anton/junkcode/context_switch2.c
./context_switch2 --test=yield --process 0 0
1. https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-October/135700.html
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/include/asm/paca.h | 17 +++++++++++++++--
arch/powerpc/kernel/asm-offsets.c | 8 ++++----
arch/powerpc/mm/hash_utils_64.c | 4 ++--
3 files changed, 21 insertions(+), 8 deletions(-)
@@ -877,11 +877,11 @@ static unsigned int get_paca_psize(unsigned long addr)unsignedlongindex,mask_index;if(addr<SLICE_LOW_TOP){-lpsizes=get_paca()->context.low_slices_psize;+lpsizes=get_paca()->context_low_slices_psize;index=GET_LOW_SLICE_INDEX(addr);return(lpsizes>>(index*4))&0xF;}-hpsizes=get_paca()->context.high_slices_psize;+hpsizes=get_paca()->context_high_slices_psize;index=GET_HIGH_SLICE_INDEX(addr);mask_index=index&0x1;return(hpsizes[index>>1]>>(mask_index*4))&0xF;
From: Anton Blanchard <hidden> Date: 2015-12-09 12:17:38
Currently we copy the whole mm_context_t to the paca but only access a
few bits of it. This is wasteful of space paca and also takes quite
some time in the hot path of context switching.
This patch pulls in only the required bits from the mm_context_t to
the paca and on context switch, copies only those.
Benchmarking this (On top of Anton's recent MSR context switching
changes [1]) using processes and yield shows an improvement of almost
3% on POWER8:
http://ozlabs.org/~anton/junkcode/context_switch2.c
./context_switch2 --test=yield --process 0 0
Now the context switch series is in, I tested this against powerpc-next
and still see a ~3% improvement.
Anton
From: Michael Neuling <hidden> Date: 2015-12-10 03:46:51
Currently we copy the whole mm_context_t to the paca but only access a
few bits of it. This is wasteful of space paca and also takes quite
some time in the hot path of context switching.
This patch pulls in only the required bits from the mm_context_t to
the paca and on context switch, copies only those.
Benchmarking this (On top of Anton's recent MSR context switching
changes [1]) using processes and yield shows an improvement of almost
3% on POWER8:
http://ozlabs.org/~anton/junkcode/context_switch2.c
./context_switch2 --test=3Dyield --process 0 0
1. https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-October/135700.
html
Signed-off-by: Michael Neuling <redacted>
---
v2:
Added missing include which broke allmodconfig (noticed by anton)
include/asm/paca.h | 18 ++++++++++++++++--
kernel/asm-offsets.c | 8 ++++----
mm/hash_utils_64.c | 4 ++--
3 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/include/asm/paca.h
b/arch/powerpc/include/asm/paca.h
index 1cc6e08..06cdaee 100644
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-12-10 10:00:30
On Thu, 2015-12-10 at 14:46 +1100, Michael Neuling wrote:
quoted hunk
Currently we copy the whole mm_context_t to the paca but only access a
few bits of it. This is wasteful of space paca and also takes quite
some time in the hot path of context switching.
diff --git a/arch/powerpc/include/asm/paca.h
b/arch/powerpc/include/asm/paca.h
index 1cc6e08..06cdaee 100644
From: Michael Neuling <hidden> Date: 2015-12-10 22:34:42
Currently we copy the whole mm_context_t to the paca but only access a
few bits of it. This is wasteful of space paca and also takes quite
some time in the hot path of context switching.
This patch pulls in only the required bits from the mm_context_t to
the paca and on context switch, copies only those.
Benchmarking this (On top of Anton's recent MSR context switching
changes [1]) using processes and yield shows an improvement of almost
3% on POWER8:
http://ozlabs.org/~anton/junkcode/context_switch2.c
./context_switch2 --test=3Dyield --process 0 0
1. https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-October/135700.html
Signed-off-by: Michael Neuling <redacted>
--
v3:
Fix line wrapping (WTF sorry!?!)
v2:
Added missing include which broke allmodconfig (noticed by anton)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-01-11 09:14:01
On Wed, 2015-28-10 at 04:54:06 UTC, Michael Neuling wrote:
This adds a function to copy the mm->context to the paca. This is
only a basic conversion for now but will be used more extensively in
the next patch.
This also adds #ifdef CONFIG_PPC_BOOK3S around this code since it's
not used elsewhere.
Signed-off-by: Michael Neuling <redacted>
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-01-11 09:14:02
On Thu, 2015-10-12 at 22:34:42 UTC, Michael Neuling wrote:
Currently we copy the whole mm_context_t to the paca but only access a
few bits of it. This is wasteful of space paca and also takes quite
some time in the hot path of context switching.
This patch pulls in only the required bits from the mm_context_t to
the paca and on context switch, copies only those.
Benchmarking this (On top of Anton's recent MSR context switching
changes [1]) using processes and yield shows an improvement of almost
3% on POWER8:
http://ozlabs.org/~anton/junkcode/context_switch2.c
./context_switch2 --test=yield --process 0 0
1. https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-October/135700.html
Signed-off-by: Michael Neuling <redacted>