The patch titled Subject: x86: unify native_*_get_and_clear !SMP case has been added to the -mm tree. Its filename is x86-unify-native__get_and_clear-smp-case.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/x86-unify-native__get_and_clear-smp-case.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/x86-unify-native__get_and_clear-smp-case.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Matthew Wilcox <willy@xxxxxxxxxxxxxxx> Subject: x86: unify native_*_get_and_clear !SMP case x86_32 and x86_64 had diverged slightly in their implementations of the non-SMP cases for native_ptep_get_and_clear() and native_pmdp_get_and_clear(). Unify the non-SMP cases in pgtable.h, leaving only the SMP cases in the other three files. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@xxxxxxxxx> Cc: Dave Chinner <david@xxxxxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: Theodore Ts'o <tytso@xxxxxxx> Cc: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/x86/include/asm/pgtable-2level.h | 6 ------ arch/x86/include/asm/pgtable-3level.h | 7 +------ arch/x86/include/asm/pgtable.h | 5 +++++ arch/x86/include/asm/pgtable_64.h | 18 ++---------------- 4 files changed, 8 insertions(+), 28 deletions(-) diff -puN arch/x86/include/asm/pgtable-2level.h~x86-unify-native__get_and_clear-smp-case arch/x86/include/asm/pgtable-2level.h --- a/arch/x86/include/asm/pgtable-2level.h~x86-unify-native__get_and_clear-smp-case +++ a/arch/x86/include/asm/pgtable-2level.h @@ -42,17 +42,11 @@ static inline pte_t native_ptep_get_and_ { return __pte(xchg(&xp->pte_low, 0)); } -#else -#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) -#endif -#ifdef CONFIG_SMP static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp) { return __pmd(xchg((pmdval_t *)xp, 0)); } -#else -#define native_pmdp_get_and_clear(xp) native_local_pmdp_get_and_clear(xp) #endif /* Bit manipulation helper on pte/pgoff entry */ diff -puN arch/x86/include/asm/pgtable-3level.h~x86-unify-native__get_and_clear-smp-case arch/x86/include/asm/pgtable-3level.h --- a/arch/x86/include/asm/pgtable-3level.h~x86-unify-native__get_and_clear-smp-case +++ a/arch/x86/include/asm/pgtable-3level.h @@ -149,11 +149,7 @@ static inline pte_t native_ptep_get_and_ return res; } -#else -#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) -#endif -#ifdef CONFIG_SMP union split_pmd { struct { u32 pmd_low; @@ -161,6 +157,7 @@ union split_pmd { }; pmd_t pmd; }; + static inline pmd_t native_pmdp_get_and_clear(pmd_t *pmdp) { union split_pmd res, *orig = (union split_pmd *)pmdp; @@ -172,8 +169,6 @@ static inline pmd_t native_pmdp_get_and_ return res.pmd; } -#else -#define native_pmdp_get_and_clear(xp) native_local_pmdp_get_and_clear(xp) #endif /* Encode and de-code a swap entry */ diff -puN arch/x86/include/asm/pgtable.h~x86-unify-native__get_and_clear-smp-case arch/x86/include/asm/pgtable.h --- a/arch/x86/include/asm/pgtable.h~x86-unify-native__get_and_clear-smp-case +++ a/arch/x86/include/asm/pgtable.h @@ -746,6 +746,11 @@ static inline pmd_t native_local_pmdp_ge return res; } +#ifndef CONFIG_SMP +#define native_ptep_get_and_clear(p) native_local_ptep_get_and_clear(p) +#define native_pmdp_get_and_clear(p) native_local_pmdp_get_and_clear(p) +#endif + static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep , pte_t pte) { diff -puN arch/x86/include/asm/pgtable_64.h~x86-unify-native__get_and_clear-smp-case arch/x86/include/asm/pgtable_64.h --- a/arch/x86/include/asm/pgtable_64.h~x86-unify-native__get_and_clear-smp-case +++ a/arch/x86/include/asm/pgtable_64.h @@ -70,31 +70,17 @@ static inline void native_pmd_clear(pmd_ native_set_pmd(pmd, native_make_pmd(0)); } +#ifdef CONFIG_SMP static inline pte_t native_ptep_get_and_clear(pte_t *xp) { -#ifdef CONFIG_SMP return native_make_pte(xchg(&xp->pte, 0)); -#else - /* native_local_ptep_get_and_clear, - but duplicated because of cyclic dependency */ - pte_t ret = *xp; - native_pte_clear(NULL, 0, xp); - return ret; -#endif } static inline pmd_t native_pmdp_get_and_clear(pmd_t *xp) { -#ifdef CONFIG_SMP return native_make_pmd(xchg(&xp->pmd, 0)); -#else - /* native_local_pmdp_get_and_clear, - but duplicated because of cyclic dependency */ - pmd_t ret = *xp; - native_pmd_clear(xp); - return ret; -#endif } +#endif static inline void native_set_pud(pud_t *pudp, pud_t pud) { _ Patches currently in -mm which might be from willy@xxxxxxxxxxxxxxx are mmdebug-always-evaluate-the-arguments-to-vm_bug_on_.patch mm-convert-an-open-coded-vm_bug_on_vma.patch mmfsdax-change-pmd_fault-to-huge_fault.patch mm-add-support-for-pud-sized-transparent-hugepages.patch mincore-add-support-for-puds.patch procfs-add-support-for-puds-to-smaps-clear_refs-and-pagemap.patch x86-unify-native__get_and_clear-smp-case.patch x86-fix-whitespace-issues.patch x86-add-support-for-pud-sized-transparent-hugepages.patch dax-support-for-transparent-pud-pages.patch ext4-support-for-pud-sized-transparent-huge-pages.patch dax-use-vmf-gfp_mask.patch dax-remove-unnecessary-rechecking-of-i_size.patch dax-use-vmf-pgoff-in-fault-handlers.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html