[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180426142804.180152-5-zi.yan@sent.com>
Date: Thu, 26 Apr 2018 10:27:59 -0400
From: Zi Yan <zi.yan@...t.com>
To: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: Zi Yan <zi.yan@...rutgers.edu>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
x86@...nel.org
Subject: [RFC PATCH 4/9] i386: mm: migrate: add pmd swap entry to support thp migration.
From: Zi Yan <zi.yan@...rutgers.edu>
Signed-off-by: Zi Yan <zi.yan@...rutgers.edu>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
Cc: x86@...nel.org
Cc: linux-mm@...ck.org
---
arch/x86/include/asm/pgtable-2level.h | 2 ++
arch/x86/include/asm/pgtable-3level.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h
index 685ffe8a0eaf..fba4722ec2c2 100644
--- a/arch/x86/include/asm/pgtable-2level.h
+++ b/arch/x86/include/asm/pgtable-2level.h
@@ -93,6 +93,8 @@ static inline unsigned long pte_bitop(unsigned long value, unsigned int rightshi
((type) << (_PAGE_BIT_PRESENT + 1)) \
| ((offset) << SWP_OFFSET_SHIFT) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low })
+#define __pmd_to_swp_entry(pmd) ((swp_entry_t) { native_pmd_val(pmd) })
#define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val })
+#define __swp_entry_to_pmd(x) (native_make_pmd(x.val))
#endif /* _ASM_X86_PGTABLE_2LEVEL_H */
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
index f24df59c40b2..9b7e3c74fbc0 100644
--- a/arch/x86/include/asm/pgtable-3level.h
+++ b/arch/x86/include/asm/pgtable-3level.h
@@ -246,7 +246,9 @@ static inline pud_t native_pudp_get_and_clear(pud_t *pudp)
#define __swp_offset(x) ((x).val >> 5)
#define __swp_entry(type, offset) ((swp_entry_t){(type) | (offset) << 5})
#define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high })
+#define __pmd_to_swp_entry(pmd) ((swp_entry_t){ (pmd).pmd_high })
#define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } })
+#define __swp_entry_to_pmd(x) ((pmd_t){ { .pmd_high = (x).val } })
#define gup_get_pte gup_get_pte
/*
--
2.17.0
Powered by blists - more mailing lists