[RFC PATCH 7/9] s390: mm: migrate: add pmd swap entry to support thp migration.

From: Zi Yan
Date: Thu Apr 26 2018 - 10:30:31 EST


From: Zi Yan <zi.yan@xxxxxxxxxxxxxx>

pmd swap soft dirty support is added, too.

Signed-off-by: Zi Yan <zi.yan@xxxxxxxxxxxxxx>
Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Cc: Janosch Frank <frankja@xxxxxxxxxxxxxxxxxx>
Cc: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
Cc: linux-s390@xxxxxxxxxxxxxxx
Cc: linux-mm@xxxxxxxxx
---
arch/s390/include/asm/pgtable.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 2d24d33bf188..215fbb34203e 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -798,18 +798,21 @@ static inline int pmd_soft_dirty(pmd_t pmd)
{
return pmd_val(pmd) & _SEGMENT_ENTRY_SOFT_DIRTY;
}
+#define pmd_swp_soft_dirty pmd_soft_dirty

static inline pmd_t pmd_mksoft_dirty(pmd_t pmd)
{
pmd_val(pmd) |= _SEGMENT_ENTRY_SOFT_DIRTY;
return pmd;
}
+#define pmd_swp_mksoft_dirty pmd_mksoft_dirty

static inline pmd_t pmd_clear_soft_dirty(pmd_t pmd)
{
pmd_val(pmd) &= ~_SEGMENT_ENTRY_SOFT_DIRTY;
return pmd;
}
+#define pmd_swp_clear_soft_dirty pmd_clear_soft_dirty

/*
* query functions pte_write/pte_dirty/pte_young only work if
@@ -1594,7 +1597,9 @@ static inline swp_entry_t __swp_entry(unsigned long type, unsigned long offset)
}

#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
+#define __pmd_to_swp_entry(pte) ((swp_entry_t) { pmd_val(pmd) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
+#define __swp_entry_to_pmd(x) ((pmd_t) { (x).val })

#define kern_addr_valid(addr) (1)

--
2.17.0