Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.
Signed-off-by: Aneesh Kumar K.V <redacted>
---
arch/powerpc/include/asm/pgtable-ppc64.h | 26 +++++++++++++++++++++-----
arch/powerpc/include/asm/pte-book3e.h | 1 +
arch/powerpc/include/asm/pte-hash64.h | 1 +
3 files changed, 23 insertions(+), 5 deletions(-)
@@ -16,6 +16,7 @@*/#define _PAGE_PRESENT 0x0001 /* software: pte contains a translation */#define _PAGE_USER 0x0002 /* matches one of the PP bits */+#define _PAGE_BIT_SWAP_TYPE 2#define _PAGE_EXEC 0x0004 /* No execute on POWER4 and newer (we invert) */#define _PAGE_GUARDED 0x0008/* We can derive Memory coherence from _PAGE_NO_CACHE */
"Aneesh Kumar K.V" [off-list ref] writes:
Hi Scott,
Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.
Can you please review this w.r.t 64bit booke ?
-aneesh
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-06-17 09:45:49
On Wed, 2015-06-17 at 08:21 +0530, Aneesh Kumar K.V wrote:
"Aneesh Kumar K.V" [off-list ref] writes:
Hi Scott,
quoted
Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.
From: Scott Wood <hidden> Date: 2015-06-17 21:14:40
On Wed, 2015-06-17 at 19:45 +1000, Michael Ellerman wrote:
On Wed, 2015-06-17 at 08:21 +0530, Aneesh Kumar K.V wrote:
quoted
"Aneesh Kumar K.V" [off-list ref] writes:
Hi Scott,
quoted
Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.
Can you please review this w.r.t 64bit booke ?
It looks OK.
I'm curious why _PAGE_BIT_SWAP_TYPE is 2 -- it seems like it could be
any value >= 1 that isn't large enough to cause a conflict. Does
something get stored in that second bit?
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2015-06-18 04:16:00
On Wed, 2015-06-17 at 16:14 -0500, Scott Wood wrote:
On Wed, 2015-06-17 at 19:45 +1000, Michael Ellerman wrote:
quoted
On Wed, 2015-06-17 at 08:21 +0530, Aneesh Kumar K.V wrote:
quoted
"Aneesh Kumar K.V" [off-list ref] writes:
Hi Scott,
quoted
Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.
Can you please review this w.r.t 64bit booke ?
It looks OK.
I'm curious why _PAGE_BIT_SWAP_TYPE is 2 -- it seems like it could be
any value >= 1 that isn't large enough to cause a conflict. Does
something get stored in that second bit?
quoted
I booted it on our p5020ds FWIW.
Actively using swap?
Yeah good point, it wasn't.
I ran 4 make -j kernel builds in parallel which seemed to do the trick:
total used free shared buffers cached
Mem: 4053952 4038324 15628 344 2880 26932
-/+ buffers/cache: 4008512 45440
Swap: 7918588 6102800 1815788
Of course it went OOM not long after that, but it's still pinging and it's
running fine, just spending all its time printing the OOM kill info to the
console.
cheers
On Wed, 2015-06-17 at 19:45 +1000, Michael Ellerman wrote:
quoted
On Wed, 2015-06-17 at 08:21 +0530, Aneesh Kumar K.V wrote:
quoted
"Aneesh Kumar K.V" [off-list ref] writes:
Hi Scott,
quoted
Current swap encoding in pte can't support large pfns
above 4TB. Change the swap encoding such that we put
the swap type in the PTE bits. Also add build checks
to make sure we don't overlap with HPTEFLAGS.
Can you please review this w.r.t 64bit booke ?
It looks OK.
I'm curious why _PAGE_BIT_SWAP_TYPE is 2 -- it seems like it could be
any value >= 1 that isn't large enough to cause a conflict. Does
something get stored in that second bit?
Yes, we should be able to use >= 1. But then our _PAGE_USER is also used
to indicate prot_none. It should really be _PAGE_PRESENT set and
_PAGE_USER cleared. So for the swap case we should be ok to use
_PAGE_USER. But i didn't want to audit all the asm code. So i decided to
leave _PAGE_USER as it is.