From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 00/12] THP support for ARC Date: Tue, 22 Sep 2015 16:04:44 +0530 Message-ID: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Hi, This series brings THP support to ARC. It also introduces an optional new thp hook for arches to possibly optimize the TLB flush in thp regime. Please review ! Changes Since v1 [*] - Rebased against v4.3-rc2 - Switched ARC pgtable_t to pte_t * (Kiril) - Removed stub implementations for (Andrew) pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, pmdp_collapse_flush, pmd_same [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com Vineet Gupta (12): ARC: mm: switch pgtable_to to pte_t * ARC: mm: pte flags comsetic cleanups, comments ARC: mm: Introduce PTE_SPECIAL Documentation/features/vm: pte_special now supported by ARC ARCv2: mm: THP support ARCv2: mm: THP: boot validation/reporting Documentation/features/vm: THP now supported by ARC mm: move some code around mm,thp: reduce ifdef'ery for THP in generic code mm,thp: introduce flush_pmd_tlb_range ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization ARCv2: Add a DT which enables THP Documentation/features/vm/THP/arch-support.txt | 2 +- .../features/vm/pte_special/arch-support.txt | 2 +- arch/arc/Kconfig | 4 + arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ arch/arc/include/asm/page.h | 5 +- arch/arc/include/asm/pgalloc.h | 6 +- arch/arc/include/asm/pgtable.h | 60 +++++++------ arch/arc/mm/tlb.c | 76 ++++++++++++++++- arch/arc/mm/tlbex.S | 21 +++-- include/asm-generic/pgtable.h | 49 ++++------- mm/huge_memory.c | 2 +- mm/pgtable-generic.c | 99 ++++++++++------------ 13 files changed, 345 insertions(+), 122 deletions(-) create mode 100644 arch/arc/boot/dts/hs_thp.dts create mode 100644 arch/arc/include/asm/hugepage.h -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 01/12] ARC: mm: switch pgtable_to to pte_t * Date: Tue, 22 Sep 2015 16:04:45 +0530 Message-ID: <1442918096-17454-2-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org ARC is the only arch with unsigned long type (vs. struct page *). Historically this was done to avoid the page_address() calls in various arch hooks which need to get the virtual/logical address of the table. Some arches alternately define it as pte_t *, and is as efficient as unsigned long (generated code doesn't change) Suggested-by: Kirill A. Shutemov Signed-off-by: Vineet Gupta --- arch/arc/include/asm/page.h | 4 ++-- arch/arc/include/asm/pgalloc.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h index 9c8aa41e45c2..2994cac1069e 100644 --- a/arch/arc/include/asm/page.h +++ b/arch/arc/include/asm/page.h @@ -43,7 +43,6 @@ typedef struct { typedef struct { unsigned long pgprot; } pgprot_t; -typedef unsigned long pgtable_t; #define pte_val(x) ((x).pte) #define pgd_val(x) ((x).pgd) @@ -60,7 +59,6 @@ typedef unsigned long pgtable_t; typedef unsigned long pte_t; typedef unsigned long pgd_t; typedef unsigned long pgprot_t; -typedef unsigned long pgtable_t; #define pte_val(x) (x) #define pgd_val(x) (x) @@ -71,6 +69,8 @@ typedef unsigned long pgtable_t; #endif +typedef pte_t * pgtable_t; + #define ARCH_PFN_OFFSET (CONFIG_LINUX_LINK_BASE >> PAGE_SHIFT) #define pfn_valid(pfn) (((pfn) - ARCH_PFN_OFFSET) < max_mapnr) diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h index 81208bfd9dcb..9149b5ca26d7 100644 --- a/arch/arc/include/asm/pgalloc.h +++ b/arch/arc/include/asm/pgalloc.h @@ -107,7 +107,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address) pgtable_t pte_pg; struct page *page; - pte_pg = __get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte()); + pte_pg = (pgtable_t)__get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte()); if (!pte_pg) return 0; memzero((void *)pte_pg, PTRS_PER_PTE * 4); @@ -128,12 +128,12 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) static inline void pte_free(struct mm_struct *mm, pgtable_t ptep) { pgtable_page_dtor(virt_to_page(ptep)); - free_pages(ptep, __get_order_pte()); + free_pages((unsigned long)ptep, __get_order_pte()); } #define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte) #define check_pgt_cache() do { } while (0) -#define pmd_pgtable(pmd) pmd_page_vaddr(pmd) +#define pmd_pgtable(pmd) ((pgtable_t) pmd_page_vaddr(pmd)) #endif /* _ASM_ARC_PGALLOC_H */ -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 02/12] ARC: mm: pte flags comsetic cleanups, comments Date: Tue, 22 Sep 2015 16:04:46 +0530 Message-ID: <1442918096-17454-3-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org No semantical changes Signed-off-by: Vineet Gupta --- arch/arc/include/asm/pgtable.h | 37 ++++++++++++++++--------------------- arch/arc/mm/tlbex.S | 2 +- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index 1281718802f7..481359fe56ae 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -60,7 +60,7 @@ #define _PAGE_EXECUTE (1<<3) /* Page has user execute perm (H) */ #define _PAGE_WRITE (1<<4) /* Page has user write perm (H) */ #define _PAGE_READ (1<<5) /* Page has user read perm (H) */ -#define _PAGE_MODIFIED (1<<6) /* Page modified (dirty) (S) */ +#define _PAGE_DIRTY (1<<6) /* Page modified (dirty) (S) */ #define _PAGE_GLOBAL (1<<8) /* Page is global (H) */ #define _PAGE_PRESENT (1<<10) /* TLB entry is valid (H) */ @@ -71,7 +71,7 @@ #define _PAGE_WRITE (1<<2) /* Page has user write perm (H) */ #define _PAGE_READ (1<<3) /* Page has user read perm (H) */ #define _PAGE_ACCESSED (1<<4) /* Page is accessed (S) */ -#define _PAGE_MODIFIED (1<<5) /* Page modified (dirty) (S) */ +#define _PAGE_DIRTY (1<<5) /* Page modified (dirty) (S) */ #if (CONFIG_ARC_MMU_VER >= 4) #define _PAGE_WTHRU (1<<7) /* Page cache mode write-thru (H) */ @@ -92,21 +92,16 @@ #define _K_PAGE_PERMS (_PAGE_EXECUTE | _PAGE_WRITE | _PAGE_READ | \ _PAGE_GLOBAL | _PAGE_PRESENT) -#ifdef CONFIG_ARC_CACHE_PAGES -#define _PAGE_DEF_CACHEABLE _PAGE_CACHEABLE -#else -#define _PAGE_DEF_CACHEABLE (0) +#ifndef CONFIG_ARC_CACHE_PAGES +#undef _PAGE_CACHEABLE +#define _PAGE_CACHEABLE 0 #endif -/* Helper for every "user" page - * -kernel can R/W/X - * -by default cached, unless config otherwise - * -present in memory - */ -#define ___DEF (_PAGE_PRESENT | _PAGE_DEF_CACHEABLE) +/* Defaults for every user page */ +#define ___DEF (_PAGE_PRESENT | _PAGE_CACHEABLE) /* Set of bits not changed in pte_modify */ -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED) +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) /* More Abbrevaited helpers */ #define PAGE_U_NONE __pgprot(___DEF) @@ -122,7 +117,7 @@ * user vaddr space - visible in all addr spaces, but kernel mode only * Thus Global, all-kernel-access, no-user-access, cached */ -#define PAGE_KERNEL __pgprot(_K_PAGE_PERMS | _PAGE_DEF_CACHEABLE) +#define PAGE_KERNEL __pgprot(_K_PAGE_PERMS | _PAGE_CACHEABLE) /* ioremap */ #define PAGE_KERNEL_NO_CACHE __pgprot(_K_PAGE_PERMS) @@ -191,16 +186,16 @@ /* Optimal Sizing of Pg Tbl - based on MMU page size */ #if defined(CONFIG_ARC_PAGE_SIZE_8K) -#define BITS_FOR_PTE 8 +#define BITS_FOR_PTE 8 /* 11:8:13 */ #elif defined(CONFIG_ARC_PAGE_SIZE_16K) -#define BITS_FOR_PTE 8 +#define BITS_FOR_PTE 8 /* 10:8:14 */ #elif defined(CONFIG_ARC_PAGE_SIZE_4K) -#define BITS_FOR_PTE 9 +#define BITS_FOR_PTE 9 /* 11:9:12 */ #endif #define BITS_FOR_PGD (32 - BITS_FOR_PTE - BITS_IN_PAGE) -#define PGDIR_SHIFT (BITS_FOR_PTE + BITS_IN_PAGE) +#define PGDIR_SHIFT (32 - BITS_FOR_PGD) #define PGDIR_SIZE (1UL << PGDIR_SHIFT) /* vaddr span, not PDG sz */ #define PGDIR_MASK (~(PGDIR_SIZE-1)) @@ -295,7 +290,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) /* Zoo of pte_xxx function */ #define pte_read(pte) (pte_val(pte) & _PAGE_READ) #define pte_write(pte) (pte_val(pte) & _PAGE_WRITE) -#define pte_dirty(pte) (pte_val(pte) & _PAGE_MODIFIED) +#define pte_dirty(pte) (pte_val(pte) & _PAGE_DIRTY) #define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) #define pte_special(pte) (0) @@ -304,8 +299,8 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) PTE_BIT_FUNC(wrprotect, &= ~(_PAGE_WRITE)); PTE_BIT_FUNC(mkwrite, |= (_PAGE_WRITE)); -PTE_BIT_FUNC(mkclean, &= ~(_PAGE_MODIFIED)); -PTE_BIT_FUNC(mkdirty, |= (_PAGE_MODIFIED)); +PTE_BIT_FUNC(mkclean, &= ~(_PAGE_DIRTY)); +PTE_BIT_FUNC(mkdirty, |= (_PAGE_DIRTY)); PTE_BIT_FUNC(mkold, &= ~(_PAGE_ACCESSED)); PTE_BIT_FUNC(mkyoung, |= (_PAGE_ACCESSED)); PTE_BIT_FUNC(exprotect, &= ~(_PAGE_EXECUTE)); diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S index f6f4c3cb505d..b8b014c6904d 100644 --- a/arch/arc/mm/tlbex.S +++ b/arch/arc/mm/tlbex.S @@ -365,7 +365,7 @@ ENTRY(EV_TLBMissD) lr r3, [ecr] or r0, r0, _PAGE_ACCESSED ; Accessed bit always btst_s r3, ECR_C_BIT_DTLB_ST_MISS ; See if it was a Write Access ? - or.nz r0, r0, _PAGE_MODIFIED ; if Write, set Dirty bit as well + or.nz r0, r0, _PAGE_DIRTY ; if Write, set Dirty bit as well st_s r0, [r1] ; Write back PTE CONV_PTE_TO_TLB -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 03/12] ARC: mm: Introduce PTE_SPECIAL Date: Tue, 22 Sep 2015 16:04:47 +0530 Message-ID: <1442918096-17454-4-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Needed for THP, but will also come in handy for fast GUP later Signed-off-by: Vineet Gupta --- arch/arc/include/asm/pgtable.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index 481359fe56ae..431a83329324 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -61,6 +61,7 @@ #define _PAGE_WRITE (1<<4) /* Page has user write perm (H) */ #define _PAGE_READ (1<<5) /* Page has user read perm (H) */ #define _PAGE_DIRTY (1<<6) /* Page modified (dirty) (S) */ +#define _PAGE_SPECIAL (1<<7) #define _PAGE_GLOBAL (1<<8) /* Page is global (H) */ #define _PAGE_PRESENT (1<<10) /* TLB entry is valid (H) */ @@ -72,6 +73,7 @@ #define _PAGE_READ (1<<3) /* Page has user read perm (H) */ #define _PAGE_ACCESSED (1<<4) /* Page is accessed (S) */ #define _PAGE_DIRTY (1<<5) /* Page modified (dirty) (S) */ +#define _PAGE_SPECIAL (1<<6) #if (CONFIG_ARC_MMU_VER >= 4) #define _PAGE_WTHRU (1<<7) /* Page cache mode write-thru (H) */ @@ -292,7 +294,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) #define pte_write(pte) (pte_val(pte) & _PAGE_WRITE) #define pte_dirty(pte) (pte_val(pte) & _PAGE_DIRTY) #define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) -#define pte_special(pte) (0) +#define pte_special(pte) (pte_val(pte) & _PAGE_SPECIAL) #define PTE_BIT_FUNC(fn, op) \ static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } @@ -305,8 +307,9 @@ PTE_BIT_FUNC(mkold, &= ~(_PAGE_ACCESSED)); PTE_BIT_FUNC(mkyoung, |= (_PAGE_ACCESSED)); PTE_BIT_FUNC(exprotect, &= ~(_PAGE_EXECUTE)); PTE_BIT_FUNC(mkexec, |= (_PAGE_EXECUTE)); +PTE_BIT_FUNC(mkspecial, |= (_PAGE_SPECIAL)); -static inline pte_t pte_mkspecial(pte_t pte) { return pte; } +#define __HAVE_ARCH_PTE_SPECIAL static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 04/12] Documentation/features/vm: pte_special now supported by ARC Date: Tue, 22 Sep 2015 16:04:48 +0530 Message-ID: <1442918096-17454-5-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Signed-off-by: Vineet Gupta --- Documentation/features/vm/pte_special/arch-support.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/features/vm/pte_special/arch-support.txt b/Documentation/features/vm/pte_special/arch-support.txt index aaaa21db6226..3de5434c857c 100644 --- a/Documentation/features/vm/pte_special/arch-support.txt +++ b/Documentation/features/vm/pte_special/arch-support.txt @@ -7,7 +7,7 @@ | arch |status| ----------------------- | alpha: | TODO | - | arc: | TODO | + | arc: | ok | | arm: | ok | | arm64: | ok | | avr32: | TODO | -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 06/12] ARCv2: mm: THP: boot validation/reporting Date: Tue, 22 Sep 2015 16:04:50 +0530 Message-ID: <1442918096-17454-7-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Signed-off-by: Vineet Gupta --- arch/arc/mm/tlb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 62da703a1681..80e28555a5de 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -703,7 +703,8 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len) if (p_mmu->s_pg_sz_m) scnprintf(super_pg, 64, "%dM Super Page%s, ", - p_mmu->s_pg_sz_m, " (not used)"); + p_mmu->s_pg_sz_m, + IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) ? "" : " (not used)"); n += scnprintf(buf + n, len - n, "MMU [v%x]\t: %dk PAGE, %sJTLB %d (%dx%d), uDTLB %d, uITLB %d %s\n", @@ -738,6 +739,11 @@ void arc_mmu_init(void) if (mmu->pg_sz_k != TO_KB(PAGE_SIZE)) panic("MMU pg size != PAGE_SIZE (%luk)\n", TO_KB(PAGE_SIZE)); + if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && + mmu->s_pg_sz_m != TO_MB(HPAGE_PMD_SIZE)) + panic("MMU Super pg size != Linux HPAGE_PMD_SIZE (%luM)\n", + (unsigned long)TO_MB(HPAGE_PMD_SIZE)); + /* Enable the MMU */ write_aux_reg(ARC_REG_PID, MMU_ENABLE); -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 05/12] ARCv2: mm: THP support Date: Tue, 22 Sep 2015 16:04:49 +0530 Message-ID: <1442918096-17454-6-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org ARC Linux implements 2 level page walk: PGD:PTE In THP regime, PTE is folded into PGD (and canonically referred to as PMD) Thus thp PMD accessors are implemented in terms of PTE (just like sparc) Signed-off-by: Vineet Gupta --- arch/arc/Kconfig | 4 +++ arch/arc/include/asm/hugepage.h | 78 +++++++++++++++++++++++++++++++++++++++++ arch/arc/include/asm/page.h | 1 + arch/arc/include/asm/pgtable.h | 16 +++++++-- arch/arc/mm/tlb.c | 48 +++++++++++++++++++++++++ arch/arc/mm/tlbex.S | 19 +++++++--- 6 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 arch/arc/include/asm/hugepage.h diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index 78c0621d5819..5912006391ed 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -76,6 +76,10 @@ config STACKTRACE_SUPPORT config HAVE_LATENCYTOP_SUPPORT def_bool y +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on ARC_MMU_V4 + source "init/Kconfig" source "kernel/Kconfig.freezer" diff --git a/arch/arc/include/asm/hugepage.h b/arch/arc/include/asm/hugepage.h new file mode 100644 index 000000000000..d7614d2af454 --- /dev/null +++ b/arch/arc/include/asm/hugepage.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + + +#ifndef _ASM_ARC_HUGEPAGE_H +#define _ASM_ARC_HUGEPAGE_H + +#include +#include + +/* + * ARC Linux implements 2 level page walk: PGD:PTE + * In THP regime, PTE is folded into PGD (and canonically referred to as PMD) + * Thus thp PMD accessors are implemented in terms of PTE (just like sparc) + */ +static inline pte_t pmd_pte(pmd_t pmd) +{ + return __pte(pmd_val(pmd)); +} + +static inline pmd_t pte_pmd(pte_t pte) +{ + return __pmd(pte_val(pte)); +} + +#define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd))) +#define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd))) +#define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) +#define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd))) +#define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) +#define pmd_mkhuge(pmd) pte_pmd(pte_mkhuge(pmd_pte(pmd))) +#define pmd_mknotpresent(pmd) pte_pmd(pte_mknotpresent(pmd_pte(pmd))) +#define pmd_mksplitting(pmd) pte_pmd(pte_mkspecial(pmd_pte(pmd))) +#define pmd_mkclean(pmd) pte_pmd(pte_mkclean(pmd_pte(pmd))) + +#define pmd_write(pmd) pte_write(pmd_pte(pmd)) +#define pmd_young(pmd) pte_young(pmd_pte(pmd)) +#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd)) +#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd)) +#define pmd_special(pmd) pte_special(pmd_pte(pmd)) + +#define mk_pmd(page, prot) pte_pmd(mk_pte(page, prot)) + +#define pmd_trans_huge(pmd) (pmd_val(pmd) & _PAGE_HW_SZ) +#define pmd_trans_splitting(pmd) (pmd_trans_huge(pmd) && pmd_special(pmd)) + +#define pfn_pmd(pfn, prot) (__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) + +static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) +{ + return pte_pmd(pte_modify(pmd_pte(pmd), newprot)); +} + +static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, + pmd_t *pmdp, pmd_t pmd) +{ + *pmdp = pmd; +} + +extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, + pmd_t *pmd); + +#define has_transparent_hugepage() 1 + +/* Generic variants assume pgtable_t is struct page *, hence need for these */ +#define __HAVE_ARCH_PGTABLE_DEPOSIT +extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, + pgtable_t pgtable); + +#define __HAVE_ARCH_PGTABLE_WITHDRAW +extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); + +#endif diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h index 2994cac1069e..37706837ef75 100644 --- a/arch/arc/include/asm/page.h +++ b/arch/arc/include/asm/page.h @@ -64,6 +64,7 @@ typedef unsigned long pgprot_t; #define pgd_val(x) (x) #define pgprot_val(x) (x) #define __pte(x) (x) +#define __pgd(x) (x) #define __pgprot(x) (x) #define pte_pgprot(x) (x) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index 431a83329324..336267f2e9d9 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -83,11 +83,13 @@ #define _PAGE_PRESENT (1<<9) /* TLB entry is valid (H) */ #if (CONFIG_ARC_MMU_VER >= 4) -#define _PAGE_SZ (1<<10) /* Page Size indicator (H) */ +#define _PAGE_HW_SZ (1<<10) /* Page Size indicator (H): 0 normal, 1 super */ #endif #define _PAGE_SHARED_CODE (1<<11) /* Shared Code page with cmn vaddr usable for shared TLB entries (H) */ + +#define _PAGE_UNUSED_BIT (1<<12) #endif /* vmalloc permissions */ @@ -99,6 +101,10 @@ #define _PAGE_CACHEABLE 0 #endif +#ifndef _PAGE_HW_SZ +#define _PAGE_HW_SZ 0 +#endif + /* Defaults for every user page */ #define ___DEF (_PAGE_PRESENT | _PAGE_CACHEABLE) @@ -125,7 +131,7 @@ #define PAGE_KERNEL_NO_CACHE __pgprot(_K_PAGE_PERMS) /* Masks for actual TLB "PD"s */ -#define PTE_BITS_IN_PD0 (_PAGE_GLOBAL | _PAGE_PRESENT) +#define PTE_BITS_IN_PD0 (_PAGE_GLOBAL | _PAGE_PRESENT | _PAGE_HW_SZ) #define PTE_BITS_RWX (_PAGE_EXECUTE | _PAGE_WRITE | _PAGE_READ) #define PTE_BITS_NON_RWX_IN_PD1 (PAGE_MASK | _PAGE_CACHEABLE) @@ -299,6 +305,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) #define PTE_BIT_FUNC(fn, op) \ static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } +PTE_BIT_FUNC(mknotpresent, &= ~(_PAGE_PRESENT)); PTE_BIT_FUNC(wrprotect, &= ~(_PAGE_WRITE)); PTE_BIT_FUNC(mkwrite, |= (_PAGE_WRITE)); PTE_BIT_FUNC(mkclean, &= ~(_PAGE_DIRTY)); @@ -308,6 +315,7 @@ PTE_BIT_FUNC(mkyoung, |= (_PAGE_ACCESSED)); PTE_BIT_FUNC(exprotect, &= ~(_PAGE_EXECUTE)); PTE_BIT_FUNC(mkexec, |= (_PAGE_EXECUTE)); PTE_BIT_FUNC(mkspecial, |= (_PAGE_SPECIAL)); +PTE_BIT_FUNC(mkhuge, |= (_PAGE_HW_SZ)); #define __HAVE_ARCH_PTE_SPECIAL @@ -381,6 +389,10 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, * remap a physical page `pfn' of size `size' with page protection `prot' * into virtual address `from' */ +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +#include +#endif + #include /* to cope with aliasing VIPT cache */ diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 2c7ce8bb7475..62da703a1681 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -580,6 +580,54 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long vaddr_unaligned, } } +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + +void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, + pmd_t *pmd) +{ + pte_t pte = __pte(pmd_val(*pmd)); + update_mmu_cache(vma, addr, &pte); +} + +void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, + pgtable_t pgtable) +{ + struct list_head *lh = (struct list_head *) pgtable; + + assert_spin_locked(&mm->page_table_lock); + + /* FIFO */ + if (!pmd_huge_pte(mm, pmdp)) + INIT_LIST_HEAD(lh); + else + list_add(lh, (struct list_head *) pmd_huge_pte(mm, pmdp)); + pmd_huge_pte(mm, pmdp) = pgtable; +} + +pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) +{ + struct list_head *lh; + pgtable_t pgtable; + + assert_spin_locked(&mm->page_table_lock); + + pgtable = pmd_huge_pte(mm, pmdp); + lh = (struct list_head *) pgtable; + if (list_empty(lh)) + pmd_huge_pte(mm, pmdp) = NULL; + else { + pmd_huge_pte(mm, pmdp) = (pgtable_t) lh->next; + list_del(lh); + } + + pte_val(pgtable[0]) = 0; + pte_val(pgtable[1]) = 0; + + return pgtable; +} + +#endif + /* Read the Cache Build Confuration Registers, Decode them and save into * the cpuinfo structure for later use. * No Validation is done here, simply read/convert the BCRs diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S index b8b014c6904d..552594897655 100644 --- a/arch/arc/mm/tlbex.S +++ b/arch/arc/mm/tlbex.S @@ -205,10 +205,18 @@ ex_saved_reg1: #endif lsr r0, r2, PGDIR_SHIFT ; Bits for indexing into PGD - ld.as r1, [r1, r0] ; PGD entry corresp to faulting addr - and.f r1, r1, PAGE_MASK ; Ignoring protection and other flags - ; contains Ptr to Page Table - bz.d do_slow_path_pf ; if no Page Table, do page fault + ld.as r3, [r1, r0] ; PGD entry corresp to faulting addr + tst r3, r3 + bz do_slow_path_pf ; if no Page Table, do page fault + +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + and.f 0, r3, _PAGE_HW_SZ ; Is this Huge PMD (thp) + add2.nz r1, r1, r0 + bnz.d 2f ; YES: PGD == PMD has THP PTE: stop pgd walk + mov.nz r0, r3 + +#endif + and r1, r3, PAGE_MASK ; Get the PTE entry: The idea is ; (1) x = addr >> PAGE_SHIFT -> masks page-off bits from @fault-addr @@ -219,6 +227,9 @@ ex_saved_reg1: lsr r0, r2, (PAGE_SHIFT - 2) and r0, r0, ( (PTRS_PER_PTE - 1) << 2) ld.aw r0, [r1, r0] ; get PTE and PTE ptr for fault addr + +2: + #ifdef CONFIG_ARC_DBG_TLB_MISS_COUNT and.f 0, r0, _PAGE_PRESENT bz 1f -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 07/12] Documentation/features/vm: THP now supported by ARC Date: Tue, 22 Sep 2015 16:04:51 +0530 Message-ID: <1442918096-17454-8-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Signed-off-by: Vineet Gupta --- Documentation/features/vm/THP/arch-support.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/features/vm/THP/arch-support.txt b/Documentation/features/vm/THP/arch-support.txt index df384e3e845f..523f8307b9cd 100644 --- a/Documentation/features/vm/THP/arch-support.txt +++ b/Documentation/features/vm/THP/arch-support.txt @@ -7,7 +7,7 @@ | arch |status| ----------------------- | alpha: | TODO | - | arc: | .. | + | arc: | ok | | arm: | ok | | arm64: | ok | | avr32: | .. | -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 08/12] mm: move some code around Date: Tue, 22 Sep 2015 16:04:52 +0530 Message-ID: <1442918096-17454-9-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org This reduces/simplifies the diff for the next patch which moves THP specific code. Signed-off-by: Vineet Gupta --- mm/pgtable-generic.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 6b674e00153c..48851894e699 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -57,6 +57,31 @@ int ptep_set_access_flags(struct vm_area_struct *vma, } #endif +#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH +int ptep_clear_flush_young(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep) +{ + int young; + young = ptep_test_and_clear_young(vma, address, ptep); + if (young) + flush_tlb_page(vma, address); + return young; +} +#endif + +#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH +pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, + pte_t *ptep) +{ + struct mm_struct *mm = (vma)->vm_mm; + pte_t pte; + pte = ptep_get_and_clear(mm, address, ptep); + if (pte_accessible(mm, pte)) + flush_tlb_page(vma, address); + return pte; +} +#endif + #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp, @@ -77,18 +102,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, } #endif -#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH -int ptep_clear_flush_young(struct vm_area_struct *vma, - unsigned long address, pte_t *ptep) -{ - int young; - young = ptep_test_and_clear_young(vma, address, ptep); - if (young) - flush_tlb_page(vma, address); - return young; -} -#endif - #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH int pmdp_clear_flush_young(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) @@ -106,19 +119,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, } #endif -#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH -pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, - pte_t *ptep) -{ - struct mm_struct *mm = (vma)->vm_mm; - pte_t pte; - pte = ptep_get_and_clear(mm, address, ptep); - if (pte_accessible(mm, pte)) - flush_tlb_page(vma, address); - return pte; -} -#endif - #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH #ifdef CONFIG_TRANSPARENT_HUGEPAGE pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 09/12] mm,thp: reduce ifdef'ery for THP in generic code Date: Tue, 22 Sep 2015 16:04:53 +0530 Message-ID: <1442918096-17454-10-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org - pgtable-generic.c: Fold individual #ifdef for each helper into a top level #ifdef. Makes code more readable - Per Andrew's suggestion removed the dummy implementations for !THP in asm-generic/page-table.h to have build time failures vs. runtime. Signed-off-by: Vineet Gupta --- include/asm-generic/pgtable.h | 49 ++++++++++++++++--------------------------- mm/pgtable-generic.c | 24 +++------------------ 2 files changed, 21 insertions(+), 52 deletions(-) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 29c57b2cb344..2112f4147816 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -30,9 +30,12 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, #endif #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS +#ifdef CONFIG_TRANSPARENT_HUGEPAGE extern int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp, pmd_t entry, int dirty); + +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG @@ -64,14 +67,6 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd)); return r; } -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ -static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, - unsigned long address, - pmd_t *pmdp) -{ - BUG(); - return 0; -} #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif @@ -81,8 +76,21 @@ int ptep_clear_flush_young(struct vm_area_struct *vma, #endif #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH -int pmdp_clear_flush_young(struct vm_area_struct *vma, - unsigned long address, pmd_t *pmdp); +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +extern int pmdp_clear_flush_young(struct vm_area_struct *vma, + unsigned long address, pmd_t *pmdp); +#else +/* + * Despite relevant to THP only, this API is called from generic rmap code + * under PageTransHuge(), hence needs a dummy implementation for !THP + */ +static inline int pmdp_clear_flush_young(struct vm_area_struct *vma, + unsigned long address, pmd_t *pmdp) +{ + BUG(); + return 0; +} +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR @@ -175,12 +183,6 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, pmd_t old_pmd = *pmdp; set_pmd_at(mm, address, pmdp, pmd_wrprotect(old_pmd)); } -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ -static inline void pmdp_set_wrprotect(struct mm_struct *mm, - unsigned long address, pmd_t *pmdp) -{ - BUG(); -} #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif @@ -193,15 +195,6 @@ extern void pmdp_splitting_flush(struct vm_area_struct *vma, #ifdef CONFIG_TRANSPARENT_HUGEPAGE extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp); -#else -static inline pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, - unsigned long address, - pmd_t *pmdp) -{ - BUILD_BUG(); - return *pmdp; -} -#define pmdp_collapse_flush pmdp_collapse_flush #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif @@ -245,12 +238,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) { return pmd_val(pmd_a) == pmd_val(pmd_b); } -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ -static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) -{ - BUG(); - return 0; -} #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 48851894e699..c9c59bb75a17 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -82,12 +82,13 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, } #endif +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp, pmd_t entry, int dirty) { -#ifdef CONFIG_TRANSPARENT_HUGEPAGE int changed = !pmd_same(*pmdp, entry); VM_BUG_ON(address & ~HPAGE_PMD_MASK); if (changed) { @@ -95,10 +96,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } return changed; -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ - BUG(); - return 0; -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ } #endif @@ -107,11 +104,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { int young; -#ifdef CONFIG_TRANSPARENT_HUGEPAGE VM_BUG_ON(address & ~HPAGE_PMD_MASK); -#else - BUG(); -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ young = pmdp_test_and_clear_young(vma, address, pmdp); if (young) flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); @@ -120,7 +113,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, #endif #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH -#ifdef CONFIG_TRANSPARENT_HUGEPAGE pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { @@ -131,11 +123,9 @@ pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return pmd; } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH -#ifdef CONFIG_TRANSPARENT_HUGEPAGE void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { @@ -145,11 +135,9 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, /* tlb flush only to serialize against gup-fast */ flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PGTABLE_DEPOSIT -#ifdef CONFIG_TRANSPARENT_HUGEPAGE void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, pgtable_t pgtable) { @@ -162,11 +150,9 @@ void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, list_add(&pgtable->lru, &pmd_huge_pte(mm, pmdp)->lru); pmd_huge_pte(mm, pmdp) = pgtable; } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PGTABLE_WITHDRAW -#ifdef CONFIG_TRANSPARENT_HUGEPAGE /* no "address" argument so destroys page coloring of some arch */ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) { @@ -185,11 +171,9 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) } return pgtable; } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef __HAVE_ARCH_PMDP_INVALIDATE -#ifdef CONFIG_TRANSPARENT_HUGEPAGE void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { @@ -197,11 +181,9 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry)); flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif #ifndef pmdp_collapse_flush -#ifdef CONFIG_TRANSPARENT_HUGEPAGE pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) { @@ -217,5 +199,5 @@ pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address, flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return pmd; } -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 10/12] mm,thp: introduce flush_pmd_tlb_range Date: Tue, 22 Sep 2015 16:04:54 +0530 Message-ID: <1442918096-17454-11-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Signed-off-by: Vineet Gupta --- mm/huge_memory.c | 2 +- mm/pgtable-generic.c | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 4b06b8db9df2..e25eb3d2081a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1880,7 +1880,7 @@ static int __split_huge_page_map(struct page *page, * here). But it is generally safer to never allow * small and huge TLB entries for the same virtual * address to be loaded simultaneously. So instead of - * doing "pmd_populate(); flush_tlb_range();" we first + * doing "pmd_populate(); flush_pmd_tlb_range();" we first * mark the current pmd notpresent (atomically because * here the pmd_trans_huge and pmd_trans_splitting * must remain set at all times on the pmd until the diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index c9c59bb75a17..b0fed9a4776e 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -84,6 +84,19 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, #ifdef CONFIG_TRANSPARENT_HUGEPAGE +#ifndef __HAVE_ARCH_FLUSH_PMD_TLB_RANGE + +/* + * ARCHes with special requirements for evicting THP backing TLB entries can + * implement this. Otherwise also, it can help optimizing thp flush operation. + * flush_tlb_range() can have optimization to nuke the entire TLB if flush span + * is greater than a threashhold, which will likely be true for a single + * huge page. + * e.g. see arch/arc: flush_pmd_tlb_range + */ +#define flush_pmd_tlb_range(vma, addr, end) flush_tlb_range(vma, addr, end) +#endif + #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp, @@ -93,7 +106,7 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, VM_BUG_ON(address & ~HPAGE_PMD_MASK); if (changed) { set_pmd_at(vma->vm_mm, address, pmdp, entry); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } return changed; } @@ -107,7 +120,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, VM_BUG_ON(address & ~HPAGE_PMD_MASK); young = pmdp_test_and_clear_young(vma, address, pmdp); if (young) - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return young; } #endif @@ -120,7 +133,7 @@ pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, VM_BUG_ON(address & ~HPAGE_PMD_MASK); VM_BUG_ON(!pmd_trans_huge(*pmdp)); pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return pmd; } #endif @@ -133,7 +146,7 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, VM_BUG_ON(address & ~HPAGE_PMD_MASK); set_pmd_at(vma->vm_mm, address, pmdp, pmd); /* tlb flush only to serialize against gup-fast */ - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } #endif @@ -179,7 +192,7 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, { pmd_t entry = *pmdp; set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry)); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } #endif @@ -196,7 +209,7 @@ pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address, VM_BUG_ON(address & ~HPAGE_PMD_MASK); VM_BUG_ON(pmd_trans_huge(*pmdp)); pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return pmd; } #endif -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 11/12] ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization Date: Tue, 22 Sep 2015 16:04:55 +0530 Message-ID: <1442918096-17454-12-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org Implement the TLB flush routine to evict a sepcific Super TLB entry, vs. moving to a new ASID on every such flush. Signed-off-by: Vineet Gupta --- arch/arc/include/asm/hugepage.h | 4 ++++ arch/arc/mm/tlb.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/arch/arc/include/asm/hugepage.h b/arch/arc/include/asm/hugepage.h index d7614d2af454..bf74f507e038 100644 --- a/arch/arc/include/asm/hugepage.h +++ b/arch/arc/include/asm/hugepage.h @@ -75,4 +75,8 @@ extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, #define __HAVE_ARCH_PGTABLE_WITHDRAW extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); +#define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE +extern void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end); + #endif diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c index 80e28555a5de..b28731c175b1 100644 --- a/arch/arc/mm/tlb.c +++ b/arch/arc/mm/tlb.c @@ -626,6 +626,26 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) return pgtable; } +void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, + unsigned long end) +{ + unsigned int cpu; + unsigned long flags; + + local_irq_save(flags); + + cpu = smp_processor_id(); + + if (likely(asid_mm(vma->vm_mm, cpu) != MM_CTXT_NO_ASID)) { + unsigned int asid = hw_pid(vma->vm_mm, cpu); + + /* No need to loop here: this will always be for 1 Huge Page */ + tlb_entry_erase(start | _PAGE_HW_SZ | asid); + } + + local_irq_restore(flags); +} + #endif /* Read the Cache Build Confuration Registers, Decode them and save into -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: [PATCH v2 12/12] ARCv2: Add a DT which enables THP Date: Tue, 22 Sep 2015 16:04:56 +0530 Message-ID: <1442918096-17454-13-git-send-email-vgupta@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vineet Gupta List-Id: linux-arch.vger.kernel.org * Enable THP at bootup * More than 512M RAM (kernel auto-disabled THP for smaller systems) Signed-off-by: Vineet Gupta --- arch/arc/boot/dts/hs_thp.dts | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 arch/arc/boot/dts/hs_thp.dts diff --git a/arch/arc/boot/dts/hs_thp.dts b/arch/arc/boot/dts/hs_thp.dts new file mode 100644 index 000000000000..818a8c968330 --- /dev/null +++ b/arch/arc/boot/dts/hs_thp.dts @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +/dts-v1/; + +/include/ "skeleton.dtsi" + +/ { + compatible = "snps,nsim_hs"; + interrupt-parent = <&core_intc>; + + chosen { + bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8 transparent_hugepage=always"; + }; + + aliases { + serial0 = &arcuart0; + }; + + memory { + device_type = "memory"; + /* reg = <0x00000000 0x28000000>; */ + reg = <0x00000000 0x40000000>; + }; + + fpga { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + + /* child and parent address space 1:1 mapped */ + ranges; + + core_intc: core-interrupt-controller { + compatible = "snps,archs-intc"; + interrupt-controller; + #interrupt-cells = <1>; + }; + + arcuart0: serial@c0fc1000 { + compatible = "snps,arc-uart"; + reg = <0xc0fc1000 0x100>; + interrupts = <24>; + clock-frequency = <80000000>; + current-speed = <115200>; + status = "okay"; + }; + + arcpct0: pct { + compatible = "snps,archs-pct"; + #interrupt-cells = <1>; + interrupts = <20>; + }; + }; +}; -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 00/12] THP support for ARC Date: Thu, 1 Oct 2015 11:32:27 +0530 Message-ID: <560CCC73.9080705@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: > Hi, > > This series brings THP support to ARC. It also introduces an optional new > thp hook for arches to possibly optimize the TLB flush in thp regime. > > Please review ! > > Changes Since v1 [*] > - Rebased against v4.3-rc2 > - Switched ARC pgtable_t to pte_t * (Kiril) > - Removed stub implementations for (Andrew) > pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, > pmdp_collapse_flush, pmd_same > > [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com > > Vineet Gupta (12): > ARC: mm: switch pgtable_to to pte_t * > ARC: mm: pte flags comsetic cleanups, comments > ARC: mm: Introduce PTE_SPECIAL > Documentation/features/vm: pte_special now supported by ARC > ARCv2: mm: THP support > ARCv2: mm: THP: boot validation/reporting > Documentation/features/vm: THP now supported by ARC > mm: move some code around > mm,thp: reduce ifdef'ery for THP in generic code > mm,thp: introduce flush_pmd_tlb_range > ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization > ARCv2: Add a DT which enables THP > > Documentation/features/vm/THP/arch-support.txt | 2 +- > .../features/vm/pte_special/arch-support.txt | 2 +- > arch/arc/Kconfig | 4 + > arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ > arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ > arch/arc/include/asm/page.h | 5 +- > arch/arc/include/asm/pgalloc.h | 6 +- > arch/arc/include/asm/pgtable.h | 60 +++++++------ > arch/arc/mm/tlb.c | 76 ++++++++++++++++- > arch/arc/mm/tlbex.S | 21 +++-- > include/asm-generic/pgtable.h | 49 ++++------- > mm/huge_memory.c | 2 +- > mm/pgtable-generic.c | 99 ++++++++++------------ > 13 files changed, 345 insertions(+), 122 deletions(-) > create mode 100644 arch/arc/boot/dts/hs_thp.dts > create mode 100644 arch/arc/include/asm/hugepage.h Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can proceed with moving the stuff into linux-next ! Thx, -Vineet -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 00/12] THP support for ARC Date: Fri, 9 Oct 2015 15:03:26 +0530 Message-ID: <561789E6.9090800@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <560CCC73.9080705@synopsys.com> Sender: owner-linux-mm@kvack.org To: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Thursday 01 October 2015 11:32 AM, Vineet Gupta wrote: > On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: >> > Hi, >> > >> > This series brings THP support to ARC. It also introduces an optional new >> > thp hook for arches to possibly optimize the TLB flush in thp regime. >> > >> > Please review ! >> > >> > Changes Since v1 [*] >> > - Rebased against v4.3-rc2 >> > - Switched ARC pgtable_t to pte_t * (Kiril) >> > - Removed stub implementations for (Andrew) >> > pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, >> > pmdp_collapse_flush, pmd_same >> > >> > [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com >> > >> > Vineet Gupta (12): >> > ARC: mm: switch pgtable_to to pte_t * >> > ARC: mm: pte flags comsetic cleanups, comments >> > ARC: mm: Introduce PTE_SPECIAL >> > Documentation/features/vm: pte_special now supported by ARC >> > ARCv2: mm: THP support >> > ARCv2: mm: THP: boot validation/reporting >> > Documentation/features/vm: THP now supported by ARC >> > mm: move some code around >> > mm,thp: reduce ifdef'ery for THP in generic code >> > mm,thp: introduce flush_pmd_tlb_range >> > ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization >> > ARCv2: Add a DT which enables THP >> > >> > Documentation/features/vm/THP/arch-support.txt | 2 +- >> > .../features/vm/pte_special/arch-support.txt | 2 +- >> > arch/arc/Kconfig | 4 + >> > arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ >> > arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ >> > arch/arc/include/asm/page.h | 5 +- >> > arch/arc/include/asm/pgalloc.h | 6 +- >> > arch/arc/include/asm/pgtable.h | 60 +++++++------ >> > arch/arc/mm/tlb.c | 76 ++++++++++++++++- >> > arch/arc/mm/tlbex.S | 21 +++-- >> > include/asm-generic/pgtable.h | 49 ++++------- >> > mm/huge_memory.c | 2 +- >> > mm/pgtable-generic.c | 99 ++++++++++------------ >> > 13 files changed, 345 insertions(+), 122 deletions(-) >> > create mode 100644 arch/arc/boot/dts/hs_thp.dts >> > create mode 100644 arch/arc/include/asm/hugepage.h > Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can > proceed with moving the stuff into linux-next ! Ping 2 ! Can I please get some acks on the generic mm bits. Some of the changes will likely collide Kirill's THP rework ! Given people rebase off of mmtomm would it be better if generic patches went thru Andrew and probably included sooner for 4.4 target ? -Vineet -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 08/12] mm: move some code around Date: Fri, 9 Oct 2015 12:48:58 +0300 Message-ID: <20151009094858.GB7873@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-9-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1442918096-17454-9-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Tue, Sep 22, 2015 at 04:04:52PM +0530, Vineet Gupta wrote: > This reduces/simplifies the diff for the next patch which moves THP > specific code. > > Signed-off-by: Vineet Gupta Okay, so you group pte-related helpers together, right? It would be nice to mention it in commit message. Acked-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 09/12] mm,thp: reduce ifdef'ery for THP in generic code Date: Fri, 9 Oct 2015 12:53:59 +0300 Message-ID: <20151009095359.GA7971@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-10-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1442918096-17454-10-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Tue, Sep 22, 2015 at 04:04:53PM +0530, Vineet Gupta wrote: > - pgtable-generic.c: Fold individual #ifdef for each helper into a top > level #ifdef. Makes code more readable Makes sense. > - Per Andrew's suggestion removed the dummy implementations for !THP > in asm-generic/page-table.h to have build time failures vs. runtime. I'm not sure it's a good idea. This can lead to unnecessary #ifdefs where otherwise call to helper would be eliminated by compiler as dead code. What about dummy helpers with BUILD_BUG()? > Signed-off-by: Vineet Gupta > --- > include/asm-generic/pgtable.h | 49 ++++++++++++++++--------------------------- > mm/pgtable-generic.c | 24 +++------------------ > 2 files changed, 21 insertions(+), 52 deletions(-) > > diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h > index 29c57b2cb344..2112f4147816 100644 > --- a/include/asm-generic/pgtable.h > +++ b/include/asm-generic/pgtable.h > @@ -30,9 +30,12 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, > #endif > > #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > extern int pmdp_set_access_flags(struct vm_area_struct *vma, > unsigned long address, pmd_t *pmdp, > pmd_t entry, int dirty); > + > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif > > #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG > @@ -64,14 +67,6 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, > set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd)); > return r; > } > -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ > -static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, > - unsigned long address, > - pmd_t *pmdp) > -{ > - BUG(); > - return 0; > -} > #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif > > @@ -81,8 +76,21 @@ int ptep_clear_flush_young(struct vm_area_struct *vma, > #endif > > #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH > -int pmdp_clear_flush_young(struct vm_area_struct *vma, > - unsigned long address, pmd_t *pmdp); > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > +extern int pmdp_clear_flush_young(struct vm_area_struct *vma, > + unsigned long address, pmd_t *pmdp); > +#else > +/* > + * Despite relevant to THP only, this API is called from generic rmap code > + * under PageTransHuge(), hence needs a dummy implementation for !THP > + */ Looks like a case I described above. BUILD_BUG_ON() should work fine here. > +static inline int pmdp_clear_flush_young(struct vm_area_struct *vma, > + unsigned long address, pmd_t *pmdp) > +{ > + BUG(); > + return 0; > +} > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 08/12] mm: move some code around Date: Fri, 9 Oct 2015 10:01:13 +0000 Message-ID: References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-9-git-send-email-vgupta@synopsys.com> <20151009094858.GB7873@node> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Content-Language: en-US Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" List-Id: linux-arch.vger.kernel.org On Friday 09 October 2015 03:19 PM, Kirill A. Shutemov wrote:=0A= > On Tue, Sep 22, 2015 at 04:04:52PM +0530, Vineet Gupta wrote:=0A= >> This reduces/simplifies the diff for the next patch which moves THP=0A= >> specific code.=0A= >>=0A= >> Signed-off-by: Vineet Gupta =0A= > Okay, so you group pte-related helpers together, right?=0A= > It would be nice to mention it in commit message.=0A= >=0A= > Acked-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com=0A= =0A= ------------->=0A= >From 3817cec40baf8d9bf783203bf42e15dc404d9cdd Mon Sep 17 00:00:00 2001=0A= From: Vineet Gupta =0A= Date: Thu, 9 Jul 2015 17:19:30 +0530=0A= Subject: [PATCH v3] mm: group pte related helpers together=0A= =0A= This reduces/simplifies the diff for the next patch which moves THP=0A= specific code.=0A= =0A= No semantical changes !=0A= =0A= Signed-off-by: Vineet Gupta =0A= ---=0A= mm/pgtable-generic.c | 50 +++++++++++++++++++++++++-----------------------= --=0A= 1 file changed, 25 insertions(+), 25 deletions(-)=0A= =0A= diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c=0A= index 6b674e00153c..48851894e699 100644=0A= --- a/mm/pgtable-generic.c=0A= +++ b/mm/pgtable-generic.c=0A= @@ -57,6 +57,31 @@ int ptep_set_access_flags(struct vm_area_struct *vma,=0A= }=0A= #endif=0A= =0A= +#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH=0A= +int ptep_clear_flush_young(struct vm_area_struct *vma,=0A= + unsigned long address, pte_t *ptep)=0A= +{=0A= + int young;=0A= + young =3D ptep_test_and_clear_young(vma, address, ptep);=0A= + if (young)=0A= + flush_tlb_page(vma, address);=0A= + return young;=0A= +}=0A= +#endif=0A= +=0A= +#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH=0A= +pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,= =0A= + pte_t *ptep)=0A= +{=0A= + struct mm_struct *mm =3D (vma)->vm_mm;=0A= + pte_t pte;=0A= + pte =3D ptep_get_and_clear(mm, address, ptep);=0A= + if (pte_accessible(mm, pte))=0A= + flush_tlb_page(vma, address);=0A= + return pte;=0A= +}=0A= +#endif=0A= +=0A= #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS=0A= int pmdp_set_access_flags(struct vm_area_struct *vma,=0A= unsigned long address, pmd_t *pmdp,=0A= @@ -77,18 +102,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma,= =0A= }=0A= #endif=0A= =0A= -#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH=0A= -int ptep_clear_flush_young(struct vm_area_struct *vma,=0A= - unsigned long address, pte_t *ptep)=0A= -{=0A= - int young;=0A= - young =3D ptep_test_and_clear_young(vma, address, ptep);=0A= - if (young)=0A= - flush_tlb_page(vma, address);=0A= - return young;=0A= -}=0A= -#endif=0A= -=0A= #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH=0A= int pmdp_clear_flush_young(struct vm_area_struct *vma,=0A= unsigned long address, pmd_t *pmdp)=0A= @@ -106,19 +119,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,= =0A= }=0A= #endif=0A= =0A= -#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH=0A= -pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,= =0A= - pte_t *ptep)=0A= -{=0A= - struct mm_struct *mm =3D (vma)->vm_mm;=0A= - pte_t pte;=0A= - pte =3D ptep_get_and_clear(mm, address, ptep);=0A= - if (pte_accessible(mm, pte))=0A= - flush_tlb_page(vma, address);=0A= - return pte;=0A= -}=0A= -#endif=0A= -=0A= #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH=0A= #ifdef CONFIG_TRANSPARENT_HUGEPAGE=0A= pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long addr= ess,=0A= -- =0A= 1.9.1=0A= =0A= -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 10/12] mm,thp: introduce flush_pmd_tlb_range Date: Fri, 9 Oct 2015 13:08:16 +0300 Message-ID: <20151009100816.GC7873@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-11-git-send-email-vgupta@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1442918096-17454-11-git-send-email-vgupta@synopsys.com> Sender: owner-linux-mm@kvack.org To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Tue, Sep 22, 2015 at 04:04:54PM +0530, Vineet Gupta wrote: Commit message: -ENOENT. Otherwise, looks good: Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 00/12] THP support for ARC Date: Fri, 9 Oct 2015 13:10:46 +0300 Message-ID: <20151009101046.GA8081@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> <561789E6.9090800@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wi0-f179.google.com ([209.85.212.179]:33055 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754482AbbJIKKt (ORCPT ); Fri, 9 Oct 2015 06:10:49 -0400 Received: by wiclk2 with SMTP id lk2so63687457wic.0 for ; Fri, 09 Oct 2015 03:10:48 -0700 (PDT) Content-Disposition: inline In-Reply-To: <561789E6.9090800@synopsys.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org On Fri, Oct 09, 2015 at 03:03:26PM +0530, Vineet Gupta wrote: > On Thursday 01 October 2015 11:32 AM, Vineet Gupta wrote: > > On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: > >> > Hi, > >> > > >> > This series brings THP support to ARC. It also introduces an optional new > >> > thp hook for arches to possibly optimize the TLB flush in thp regime. > >> > > >> > Please review ! > >> > > >> > Changes Since v1 [*] > >> > - Rebased against v4.3-rc2 > >> > - Switched ARC pgtable_t to pte_t * (Kiril) > >> > - Removed stub implementations for (Andrew) > >> > pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, > >> > pmdp_collapse_flush, pmd_same > >> > > >> > [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com > >> > > >> > Vineet Gupta (12): > >> > ARC: mm: switch pgtable_to to pte_t * > >> > ARC: mm: pte flags comsetic cleanups, comments > >> > ARC: mm: Introduce PTE_SPECIAL > >> > Documentation/features/vm: pte_special now supported by ARC > >> > ARCv2: mm: THP support > >> > ARCv2: mm: THP: boot validation/reporting > >> > Documentation/features/vm: THP now supported by ARC > >> > mm: move some code around > >> > mm,thp: reduce ifdef'ery for THP in generic code > >> > mm,thp: introduce flush_pmd_tlb_range > >> > ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization > >> > ARCv2: Add a DT which enables THP > >> > > >> > Documentation/features/vm/THP/arch-support.txt | 2 +- > >> > .../features/vm/pte_special/arch-support.txt | 2 +- > >> > arch/arc/Kconfig | 4 + > >> > arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ > >> > arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ > >> > arch/arc/include/asm/page.h | 5 +- > >> > arch/arc/include/asm/pgalloc.h | 6 +- > >> > arch/arc/include/asm/pgtable.h | 60 +++++++------ > >> > arch/arc/mm/tlb.c | 76 ++++++++++++++++- > >> > arch/arc/mm/tlbex.S | 21 +++-- > >> > include/asm-generic/pgtable.h | 49 ++++------- > >> > mm/huge_memory.c | 2 +- > >> > mm/pgtable-generic.c | 99 ++++++++++------------ > >> > 13 files changed, 345 insertions(+), 122 deletions(-) > >> > create mode 100644 arch/arc/boot/dts/hs_thp.dts > >> > create mode 100644 arch/arc/include/asm/hugepage.h > > Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can > > proceed with moving the stuff into linux-next ! > > Ping 2 ! Sorry. > Can I please get some acks on the generic mm bits. Some of the changes > will likely collide Kirill's THP rework ! Could you check if it acctually collides? > Given people rebase off of mmtomm would it be better if generic patches went thru > Andrew and probably included sooner for 4.4 target ? > > -Vineet > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 09/12] mm,thp: reduce ifdef'ery for THP in generic code Date: Fri, 9 Oct 2015 10:10:45 +0000 Message-ID: References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-10-git-send-email-vgupta@synopsys.com> <20151009095359.GA7971@node> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Content-Language: en-US Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" List-Id: linux-arch.vger.kernel.org On Friday 09 October 2015 03:24 PM, Kirill A. Shutemov wrote:=0A= > On Tue, Sep 22, 2015 at 04:04:53PM +0530, Vineet Gupta wrote:=0A= >> - pgtable-generic.c: Fold individual #ifdef for each helper into a top= =0A= >> level #ifdef. Makes code more readable=0A= > Makes sense.=0A= >=0A= >> - Per Andrew's suggestion removed the dummy implementations for !THP=0A= >> in asm-generic/page-table.h to have build time failures vs. runtime.= =0A= > I'm not sure it's a good idea. This can lead to unnecessary #ifdefs where= =0A= > otherwise call to helper would be eliminated by compiler as dead code.=0A= >=0A= > What about dummy helpers with BUILD_BUG()?=0A= =0A= Not really. With this patch, if arch doesn't define __HAVR_ARCH_xyz - we pi= ck the=0A= default implementation. What I changed is if arch defines the __HAVE but do= esn't=0A= define the function, then instead of pickign a stub with runtime or buildti= me bug=0A= on, we simply fail the build ?=0A= =0A= Maybe I can add this to changelog to make it more explicit.=0A= =0A= >=0A= >> Signed-off-by: Vineet Gupta =0A= >> ---=0A= >> include/asm-generic/pgtable.h | 49 ++++++++++++++++--------------------= -------=0A= >> mm/pgtable-generic.c | 24 +++------------------=0A= >> 2 files changed, 21 insertions(+), 52 deletions(-)=0A= >>=0A= >> diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable= .h=0A= >> index 29c57b2cb344..2112f4147816 100644=0A= >> --- a/include/asm-generic/pgtable.h=0A= >> +++ b/include/asm-generic/pgtable.h=0A= >> @@ -30,9 +30,12 @@ extern int ptep_set_access_flags(struct vm_area_struc= t *vma,=0A= >> #endif=0A= >> =0A= >> #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS=0A= >> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE=0A= >> extern int pmdp_set_access_flags(struct vm_area_struct *vma,=0A= >> unsigned long address, pmd_t *pmdp,=0A= >> pmd_t entry, int dirty);=0A= >> +=0A= >> +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */=0A= >> #endif=0A= >> =0A= >> #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG=0A= >> @@ -64,14 +67,6 @@ static inline int pmdp_test_and_clear_young(struct vm= _area_struct *vma,=0A= >> set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd));=0A= >> return r;=0A= >> }=0A= >> -#else /* CONFIG_TRANSPARENT_HUGEPAGE */=0A= >> -static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,= =0A= >> - unsigned long address,=0A= >> - pmd_t *pmdp)=0A= >> -{=0A= >> - BUG();=0A= >> - return 0;=0A= >> -}=0A= >> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */=0A= >> #endif=0A= >> =0A= >> @@ -81,8 +76,21 @@ int ptep_clear_flush_young(struct vm_area_struct *vma= ,=0A= >> #endif=0A= >> =0A= >> #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH=0A= >> -int pmdp_clear_flush_young(struct vm_area_struct *vma,=0A= >> - unsigned long address, pmd_t *pmdp);=0A= >> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE=0A= >> +extern int pmdp_clear_flush_young(struct vm_area_struct *vma,=0A= >> + unsigned long address, pmd_t *pmdp);=0A= >> +#else=0A= >> +/*=0A= >> + * Despite relevant to THP only, this API is called from generic rmap c= ode=0A= >> + * under PageTransHuge(), hence needs a dummy implementation for !THP= =0A= >> + */=0A= > Looks like a case I described above. BUILD_BUG_ON() should work fine here= .=0A= =0A= Indeed BUILD_BUG_ON is better here.=0A= =0A= >=0A= >> +static inline int pmdp_clear_flush_young(struct vm_area_struct *vma,=0A= >> + unsigned long address, pmd_t *pmdp)=0A= >> +{=0A= >> + BUG();=0A= >> + return 0;=0A= >> +}=0A= >> +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */=0A= >> #endif=0A= =0A= -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 09/12] mm,thp: reduce ifdef'ery for THP in generic code Date: Fri, 9 Oct 2015 15:58:11 +0530 Message-ID: <561796BB.8040905@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-10-git-send-email-vgupta@synopsys.com> <20151009095359.GA7971@node> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151009095359.GA7971@node> Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Friday 09 October 2015 03:23 PM, Kirill A. Shutemov wrote: > On Tue, Sep 22, 2015 at 04:04:53PM +0530, Vineet Gupta wrote: >> > - pgtable-generic.c: Fold individual #ifdef for each helper into a top >> > level #ifdef. Makes code more readable > Makes sense. > >> > - Per Andrew's suggestion removed the dummy implementations for !THP >> > in asm-generic/page-table.h to have build time failures vs. runtime. > I'm not sure it's a good idea. This can lead to unnecessary #ifdefs where > otherwise call to helper would be eliminated by compiler as dead code. > > What about dummy helpers with BUILD_BUG()? > You are right after all. It is not so much related to __HAVE_ARCH_PMDP_xyz, but the fact that generic code can call them under PageTransHuge(). So better to provide stubs with BUILD_BUG -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 10/12] mm,thp: introduce flush_pmd_tlb_range Date: Fri, 9 Oct 2015 16:24:29 +0530 Message-ID: <56179CE5.5000807@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-11-git-send-email-vgupta@synopsys.com> <20151009100816.GC7873@node> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151009100816.GC7873@node> Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Friday 09 October 2015 03:38 PM, Kirill A. Shutemov wrote: > On Tue, Sep 22, 2015 at 04:04:54PM +0530, Vineet Gupta wrote: > > Commit message: -ENOENT. > > Otherwise, looks good: > > Acked-by: Kirill A. Shutemov With updated change log and some reworking in the source code comment ! ----------------> >From 96537a576f99be29f65c5682d6e0e7b31028d5ba Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Fri, 20 Feb 2015 10:36:28 +0530 Subject: [PATCH v3] mm,thp: introduce flush_pmd_tlb_range ARCHes with special requirements for evicting THP backing TLB entries can implement this. Otherwise also, it can help optimize TLB flush in THP regime. stock flush_tlb_range() typically has optimization to nuke the entire TLB if flush span is greater than a certain threshhold, which will likely be true for a single huge page. Thus a single thp flush will invalidate the entrire TLB which is not desirable. e.g. see arch/arc: flush_pmd_tlb_range Signed-off-by: Vineet Gupta --- mm/huge_memory.c | 2 +- mm/pgtable-generic.c | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 4b06b8db9df2..e25eb3d2081a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1880,7 +1880,7 @@ static int __split_huge_page_map(struct page *page, * here). But it is generally safer to never allow * small and huge TLB entries for the same virtual * address to be loaded simultaneously. So instead of - * doing "pmd_populate(); flush_tlb_range();" we first + * doing "pmd_populate(); flush_pmd_tlb_range();" we first * mark the current pmd notpresent (atomically because * here the pmd_trans_huge and pmd_trans_splitting * must remain set at all times on the pmd until the diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index c9c59bb75a17..7d3db0247983 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -84,6 +84,20 @@ pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, #ifdef CONFIG_TRANSPARENT_HUGEPAGE +#ifndef __HAVE_ARCH_FLUSH_PMD_TLB_RANGE + +/* + * ARCHes with special requirements for evicting THP backing TLB entries can + * implement this. Otherwise also, it can help optimize normal TLB flush in + * THP regime. stock flush_tlb_range() typically has optimization to nuke the + * entire TLB TLB if flush span is greater than a threshhold, which will + * likely be true for a single huge page. Thus a single thp flush will + * invalidate the entire TLB which is not desitable. + * e.g. see arch/arc: flush_pmd_tlb_range + */ +#define flush_pmd_tlb_range(vma, addr, end) flush_tlb_range(vma, addr, end) +#endif + #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp, @@ -93,7 +107,7 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, VM_BUG_ON(address & ~HPAGE_PMD_MASK); if (changed) { set_pmd_at(vma->vm_mm, address, pmdp, entry); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } return changed; } @@ -107,7 +121,7 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, VM_BUG_ON(address & ~HPAGE_PMD_MASK); young = pmdp_test_and_clear_young(vma, address, pmdp); if (young) - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return young; } #endif @@ -120,7 +134,7 @@ pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address, VM_BUG_ON(address & ~HPAGE_PMD_MASK); VM_BUG_ON(!pmd_trans_huge(*pmdp)); pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return pmd; } #endif @@ -133,7 +147,7 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address, VM_BUG_ON(address & ~HPAGE_PMD_MASK); set_pmd_at(vma->vm_mm, address, pmdp, pmd); /* tlb flush only to serialize against gup-fast */ - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } #endif @@ -179,7 +193,7 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, { pmd_t entry = *pmdp; set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry)); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); } #endif @@ -196,7 +210,7 @@ pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, unsigned long address, VM_BUG_ON(address & ~HPAGE_PMD_MASK); VM_BUG_ON(pmd_trans_huge(*pmdp)); pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp); - flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); + flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); return pmd; } #endif -- 1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 00/12] THP support for ARC Date: Fri, 9 Oct 2015 16:59:43 +0530 Message-ID: <5617A527.9030902@synopsys.com> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> <561789E6.9090800@synopsys.com> <20151009101046.GA8081@node> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151009101046.GA8081@node> Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Friday 09 October 2015 03:40 PM, Kirill A. Shutemov wrote: > On Fri, Oct 09, 2015 at 03:03:26PM +0530, Vineet Gupta wrote: >> On Thursday 01 October 2015 11:32 AM, Vineet Gupta wrote: >>> On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: >>>>> Hi, >>>>> >>>>> This series brings THP support to ARC. It also introduces an optional new >>>>> thp hook for arches to possibly optimize the TLB flush in thp regime. >>>>> >>>>> Please review ! >>>>> >>>>> Changes Since v1 [*] >>>>> - Rebased against v4.3-rc2 >>>>> - Switched ARC pgtable_t to pte_t * (Kiril) >>>>> - Removed stub implementations for (Andrew) >>>>> pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, >>>>> pmdp_collapse_flush, pmd_same >>>>> >>>>> [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com >>>>> >>>>> Vineet Gupta (12): >>>>> ARC: mm: switch pgtable_to to pte_t * >>>>> ARC: mm: pte flags comsetic cleanups, comments >>>>> ARC: mm: Introduce PTE_SPECIAL >>>>> Documentation/features/vm: pte_special now supported by ARC >>>>> ARCv2: mm: THP support >>>>> ARCv2: mm: THP: boot validation/reporting >>>>> Documentation/features/vm: THP now supported by ARC >>>>> mm: move some code around >>>>> mm,thp: reduce ifdef'ery for THP in generic code >>>>> mm,thp: introduce flush_pmd_tlb_range >>>>> ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization >>>>> ARCv2: Add a DT which enables THP >>>>> >>>>> Documentation/features/vm/THP/arch-support.txt | 2 +- >>>>> .../features/vm/pte_special/arch-support.txt | 2 +- >>>>> arch/arc/Kconfig | 4 + >>>>> arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ >>>>> arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ >>>>> arch/arc/include/asm/page.h | 5 +- >>>>> arch/arc/include/asm/pgalloc.h | 6 +- >>>>> arch/arc/include/asm/pgtable.h | 60 +++++++------ >>>>> arch/arc/mm/tlb.c | 76 ++++++++++++++++- >>>>> arch/arc/mm/tlbex.S | 21 +++-- >>>>> include/asm-generic/pgtable.h | 49 ++++------- >>>>> mm/huge_memory.c | 2 +- >>>>> mm/pgtable-generic.c | 99 ++++++++++------------ >>>>> 13 files changed, 345 insertions(+), 122 deletions(-) >>>>> create mode 100644 arch/arc/boot/dts/hs_thp.dts >>>>> create mode 100644 arch/arc/include/asm/hugepage.h >>> Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can >>> proceed with moving the stuff into linux-next ! >> >> Ping 2 ! > > Sorry. > >> Can I please get some acks on the generic mm bits. Some of the changes >> will likely collide Kirill's THP rework ! > > Could you check if it acctually collides? I rebased my changes on top of your v12 branch. As expected I get two merge conflicts as my patches update code which u have removed. But looks straight forward to resolve. Meaning we can carry respective patches and give Linus a heads up abt the merge conflict. There's also a fixup needed for ARC to remove the pmdp splitting assuming ARC THP makes it into mainline first. -Vineet > >> Given people rebase off of mmtomm would it be better if generic patches went thru >> Andrew and probably included sooner for 4.4 target ? >> >> -Vineet >> >> -- >> To unsubscribe, send a message with 'unsubscribe linux-mm' in >> the body to majordomo@kvack.org. For more info on Linux MM, >> see: http://www.linux-mm.org/ . >> Don't email: email@kvack.org > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 00/12] THP support for ARC Date: Fri, 9 Oct 2015 14:43:36 +0300 Message-ID: <20151009114336.GB8081@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> <561789E6.9090800@synopsys.com> <20151009101046.GA8081@node> <5617A527.9030902@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <5617A527.9030902@synopsys.com> Sender: owner-linux-mm@kvack.org To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Fri, Oct 09, 2015 at 04:59:43PM +0530, Vineet Gupta wrote: > On Friday 09 October 2015 03:40 PM, Kirill A. Shutemov wrote: > > On Fri, Oct 09, 2015 at 03:03:26PM +0530, Vineet Gupta wrote: > >> On Thursday 01 October 2015 11:32 AM, Vineet Gupta wrote: > >>> On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: > >>>>> Hi, > >>>>> > >>>>> This series brings THP support to ARC. It also introduces an optional new > >>>>> thp hook for arches to possibly optimize the TLB flush in thp regime. > >>>>> > >>>>> Please review ! > >>>>> > >>>>> Changes Since v1 [*] > >>>>> - Rebased against v4.3-rc2 > >>>>> - Switched ARC pgtable_t to pte_t * (Kiril) > >>>>> - Removed stub implementations for (Andrew) > >>>>> pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, > >>>>> pmdp_collapse_flush, pmd_same > >>>>> > >>>>> [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com > >>>>> > >>>>> Vineet Gupta (12): > >>>>> ARC: mm: switch pgtable_to to pte_t * > >>>>> ARC: mm: pte flags comsetic cleanups, comments > >>>>> ARC: mm: Introduce PTE_SPECIAL > >>>>> Documentation/features/vm: pte_special now supported by ARC > >>>>> ARCv2: mm: THP support > >>>>> ARCv2: mm: THP: boot validation/reporting > >>>>> Documentation/features/vm: THP now supported by ARC > >>>>> mm: move some code around > >>>>> mm,thp: reduce ifdef'ery for THP in generic code > >>>>> mm,thp: introduce flush_pmd_tlb_range > >>>>> ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization > >>>>> ARCv2: Add a DT which enables THP > >>>>> > >>>>> Documentation/features/vm/THP/arch-support.txt | 2 +- > >>>>> .../features/vm/pte_special/arch-support.txt | 2 +- > >>>>> arch/arc/Kconfig | 4 + > >>>>> arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ > >>>>> arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ > >>>>> arch/arc/include/asm/page.h | 5 +- > >>>>> arch/arc/include/asm/pgalloc.h | 6 +- > >>>>> arch/arc/include/asm/pgtable.h | 60 +++++++------ > >>>>> arch/arc/mm/tlb.c | 76 ++++++++++++++++- > >>>>> arch/arc/mm/tlbex.S | 21 +++-- > >>>>> include/asm-generic/pgtable.h | 49 ++++------- > >>>>> mm/huge_memory.c | 2 +- > >>>>> mm/pgtable-generic.c | 99 ++++++++++------------ > >>>>> 13 files changed, 345 insertions(+), 122 deletions(-) > >>>>> create mode 100644 arch/arc/boot/dts/hs_thp.dts > >>>>> create mode 100644 arch/arc/include/asm/hugepage.h > >>> Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can > >>> proceed with moving the stuff into linux-next ! > >> > >> Ping 2 ! > > > > Sorry. > > > >> Can I please get some acks on the generic mm bits. Some of the changes > >> will likely collide Kirill's THP rework ! > > > > Could you check if it acctually collides? > > I rebased my changes on top of your v12 branch. As expected I get two merge > conflicts as my patches update code which u have removed. But looks straight > forward to resolve. Meaning we can carry respective patches and give Linus a heads > up abt the merge conflict. > > There's also a fixup needed for ARC to remove the pmdp splitting assuming ARC THP > makes it into mainline first. Okay. Let's see what hits upstream first. Side question: I was surprised by your patchset. I didn't think about ARC as an architecture which would benefit from THP. How big ARC systems nowadays? How big benefit did you measured there from THP? -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vineet Gupta Subject: Re: [PATCH v2 00/12] THP support for ARC Date: Fri, 9 Oct 2015 11:52:04 +0000 Message-ID: References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> <561789E6.9090800@synopsys.com> <20151009101046.GA8081@node> <5617A527.9030902@synopsys.com> <20151009114336.GB8081@node> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Content-Language: en-US Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" List-Id: linux-arch.vger.kernel.org On Friday 09 October 2015 05:13 PM, Kirill A. Shutemov wrote:=0A= > Side question: I was surprised by your patchset. I didn't think about ARC= =0A= > as an architecture which would benefit from THP. How big ARC systems=0A= > nowadays? How big benefit did you measured there from THP? =0A= =0A= Hardware support for THP on ARC is relatively recent - as part of newly ann= ounced=0A= HS38x cores. So we don't have silicon yet to measure the performance benefi= ts. I'm=0A= currently testing this on our nsim simulator but we are slated to get silic= on with=0A= this pretty soon.=0A= =0A= If you were surprised by this you will likely be more with my highmem / PAE= 40=0A= support patches which I will send out early next week ;-)=0A= =0A= Customers these days want more future safety, if nothing else and these fea= tures=0A= were added per more of them wanting these in their designs.=0A= =0A= Thx for taking time to go thru this stuff !=0A= -Vineet=0A= -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com ([209.85.212.169]:33582 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757099AbbJIJtB (ORCPT ); Fri, 9 Oct 2015 05:49:01 -0400 Received: by wiclk2 with SMTP id lk2so62925417wic.0 for ; Fri, 09 Oct 2015 02:49:00 -0700 (PDT) Date: Fri, 9 Oct 2015 12:48:58 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 08/12] mm: move some code around Message-ID: <20151009094858.GB7873@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-9-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442918096-17454-9-git-send-email-vgupta@synopsys.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Message-ID: <20151009094858.X_Od5NMreO6bo4A_8XMi2tpJdxmSV2Tbsfij7Q4B89w@z> On Tue, Sep 22, 2015 at 04:04:52PM +0530, Vineet Gupta wrote: > This reduces/simplifies the diff for the next patch which moves THP > specific code. > > Signed-off-by: Vineet Gupta Okay, so you group pte-related helpers together, right? It would be nice to mention it in commit message. Acked-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f176.google.com ([209.85.212.176]:34516 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753653AbbJIJyC (ORCPT ); Fri, 9 Oct 2015 05:54:02 -0400 Received: by wicfx3 with SMTP id fx3so62920240wic.1 for ; Fri, 09 Oct 2015 02:54:01 -0700 (PDT) Date: Fri, 9 Oct 2015 12:53:59 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 09/12] mm,thp: reduce ifdef'ery for THP in generic code Message-ID: <20151009095359.GA7971@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-10-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442918096-17454-10-git-send-email-vgupta@synopsys.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Message-ID: <20151009095359.GAurDeIYsFl5ZKF69lQ6ssmVZsr271DME9wORmeTs6k@z> On Tue, Sep 22, 2015 at 04:04:53PM +0530, Vineet Gupta wrote: > - pgtable-generic.c: Fold individual #ifdef for each helper into a top > level #ifdef. Makes code more readable Makes sense. > - Per Andrew's suggestion removed the dummy implementations for !THP > in asm-generic/page-table.h to have build time failures vs. runtime. I'm not sure it's a good idea. This can lead to unnecessary #ifdefs where otherwise call to helper would be eliminated by compiler as dead code. What about dummy helpers with BUILD_BUG()? > Signed-off-by: Vineet Gupta > --- > include/asm-generic/pgtable.h | 49 ++++++++++++++++--------------------------- > mm/pgtable-generic.c | 24 +++------------------ > 2 files changed, 21 insertions(+), 52 deletions(-) > > diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h > index 29c57b2cb344..2112f4147816 100644 > --- a/include/asm-generic/pgtable.h > +++ b/include/asm-generic/pgtable.h > @@ -30,9 +30,12 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, > #endif > > #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > extern int pmdp_set_access_flags(struct vm_area_struct *vma, > unsigned long address, pmd_t *pmdp, > pmd_t entry, int dirty); > + > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif > > #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG > @@ -64,14 +67,6 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, > set_pmd_at(vma->vm_mm, address, pmdp, pmd_mkold(pmd)); > return r; > } > -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ > -static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma, > - unsigned long address, > - pmd_t *pmdp) > -{ > - BUG(); > - return 0; > -} > #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif > > @@ -81,8 +76,21 @@ int ptep_clear_flush_young(struct vm_area_struct *vma, > #endif > > #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH > -int pmdp_clear_flush_young(struct vm_area_struct *vma, > - unsigned long address, pmd_t *pmdp); > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > +extern int pmdp_clear_flush_young(struct vm_area_struct *vma, > + unsigned long address, pmd_t *pmdp); > +#else > +/* > + * Despite relevant to THP only, this API is called from generic rmap code > + * under PageTransHuge(), hence needs a dummy implementation for !THP > + */ Looks like a case I described above. BUILD_BUG_ON() should work fine here. > +static inline int pmdp_clear_flush_young(struct vm_area_struct *vma, > + unsigned long address, pmd_t *pmdp) > +{ > + BUG(); > + return 0; > +} > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f173.google.com ([209.85.212.173]:34966 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757276AbbJIKIU (ORCPT ); Fri, 9 Oct 2015 06:08:20 -0400 Received: by wicge5 with SMTP id ge5so61371346wic.0 for ; Fri, 09 Oct 2015 03:08:18 -0700 (PDT) Date: Fri, 9 Oct 2015 13:08:16 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 10/12] mm,thp: introduce flush_pmd_tlb_range Message-ID: <20151009100816.GC7873@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-11-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442918096-17454-11-git-send-email-vgupta@synopsys.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Message-ID: <20151009100816.Xp9xm3fRllzYyEi8KdySQtHdx5USHyj478Q3h93Czk8@z> On Tue, Sep 22, 2015 at 04:04:54PM +0530, Vineet Gupta wrote: Commit message: -ENOENT. Otherwise, looks good: Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f172.google.com ([209.85.212.172]:35772 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934875AbbJILnj (ORCPT ); Fri, 9 Oct 2015 07:43:39 -0400 Received: by wicge5 with SMTP id ge5so64657439wic.0 for ; Fri, 09 Oct 2015 04:43:38 -0700 (PDT) Date: Fri, 9 Oct 2015 14:43:36 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 00/12] THP support for ARC Message-ID: <20151009114336.GB8081@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> <561789E6.9090800@synopsys.com> <20151009101046.GA8081@node> <5617A527.9030902@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5617A527.9030902@synopsys.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Message-ID: <20151009114336.qCOymzN7oxniv0U29VXwP7M6Hvo5ti-C2IUJUM1nfyU@z> On Fri, Oct 09, 2015 at 04:59:43PM +0530, Vineet Gupta wrote: > On Friday 09 October 2015 03:40 PM, Kirill A. Shutemov wrote: > > On Fri, Oct 09, 2015 at 03:03:26PM +0530, Vineet Gupta wrote: > >> On Thursday 01 October 2015 11:32 AM, Vineet Gupta wrote: > >>> On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: > >>>>> Hi, > >>>>> > >>>>> This series brings THP support to ARC. It also introduces an optional new > >>>>> thp hook for arches to possibly optimize the TLB flush in thp regime. > >>>>> > >>>>> Please review ! > >>>>> > >>>>> Changes Since v1 [*] > >>>>> - Rebased against v4.3-rc2 > >>>>> - Switched ARC pgtable_t to pte_t * (Kiril) > >>>>> - Removed stub implementations for (Andrew) > >>>>> pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, > >>>>> pmdp_collapse_flush, pmd_same > >>>>> > >>>>> [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com > >>>>> > >>>>> Vineet Gupta (12): > >>>>> ARC: mm: switch pgtable_to to pte_t * > >>>>> ARC: mm: pte flags comsetic cleanups, comments > >>>>> ARC: mm: Introduce PTE_SPECIAL > >>>>> Documentation/features/vm: pte_special now supported by ARC > >>>>> ARCv2: mm: THP support > >>>>> ARCv2: mm: THP: boot validation/reporting > >>>>> Documentation/features/vm: THP now supported by ARC > >>>>> mm: move some code around > >>>>> mm,thp: reduce ifdef'ery for THP in generic code > >>>>> mm,thp: introduce flush_pmd_tlb_range > >>>>> ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization > >>>>> ARCv2: Add a DT which enables THP > >>>>> > >>>>> Documentation/features/vm/THP/arch-support.txt | 2 +- > >>>>> .../features/vm/pte_special/arch-support.txt | 2 +- > >>>>> arch/arc/Kconfig | 4 + > >>>>> arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ > >>>>> arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ > >>>>> arch/arc/include/asm/page.h | 5 +- > >>>>> arch/arc/include/asm/pgalloc.h | 6 +- > >>>>> arch/arc/include/asm/pgtable.h | 60 +++++++------ > >>>>> arch/arc/mm/tlb.c | 76 ++++++++++++++++- > >>>>> arch/arc/mm/tlbex.S | 21 +++-- > >>>>> include/asm-generic/pgtable.h | 49 ++++------- > >>>>> mm/huge_memory.c | 2 +- > >>>>> mm/pgtable-generic.c | 99 ++++++++++------------ > >>>>> 13 files changed, 345 insertions(+), 122 deletions(-) > >>>>> create mode 100644 arch/arc/boot/dts/hs_thp.dts > >>>>> create mode 100644 arch/arc/include/asm/hugepage.h > >>> Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can > >>> proceed with moving the stuff into linux-next ! > >> > >> Ping 2 ! > > > > Sorry. > > > >> Can I please get some acks on the generic mm bits. Some of the changes > >> will likely collide Kirill's THP rework ! > > > > Could you check if it acctually collides? > > I rebased my changes on top of your v12 branch. As expected I get two merge > conflicts as my patches update code which u have removed. But looks straight > forward to resolve. Meaning we can carry respective patches and give Linus a heads > up abt the merge conflict. > > There's also a fixup needed for ARC to remove the pmdp splitting assuming ARC THP > makes it into mainline first. Okay. Let's see what hits upstream first. Side question: I was surprised by your patchset. I didn't think about ARC as an architecture which would benefit from THP. How big ARC systems nowadays? How big benefit did you measured there from THP? -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by kanga.kvack.org (Postfix) with ESMTP id 8B27D82F65 for ; Fri, 9 Oct 2015 06:04:39 -0400 (EDT) Received: by pablk4 with SMTP id lk4so82982540pab.3 for ; Fri, 09 Oct 2015 03:04:39 -0700 (PDT) Received: from smtprelay.synopsys.com (smtprelay.synopsys.com. [198.182.47.9]) by mx.google.com with ESMTPS id ck5si1386646pbb.91.2015.10.09.03.04.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 03:04:38 -0700 (PDT) From: Vineet Gupta Subject: Re: [PATCH v2 08/12] mm: move some code around Date: Fri, 9 Oct 2015 10:01:13 +0000 Message-ID: References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-9-git-send-email-vgupta@synopsys.com> <20151009094858.GB7873@node> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" On Friday 09 October 2015 03:19 PM, Kirill A. Shutemov wrote:=0A= > On Tue, Sep 22, 2015 at 04:04:52PM +0530, Vineet Gupta wrote:=0A= >> This reduces/simplifies the diff for the next patch which moves THP=0A= >> specific code.=0A= >>=0A= >> Signed-off-by: Vineet Gupta =0A= > Okay, so you group pte-related helpers together, right?=0A= > It would be nice to mention it in commit message.=0A= >=0A= > Acked-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com=0A= =0A= ------------->=0A= >>From 3817cec40baf8d9bf783203bf42e15dc404d9cdd Mon Sep 17 00:00:00 2001=0A= From: Vineet Gupta =0A= Date: Thu, 9 Jul 2015 17:19:30 +0530=0A= Subject: [PATCH v3] mm: group pte related helpers together=0A= =0A= This reduces/simplifies the diff for the next patch which moves THP=0A= specific code.=0A= =0A= No semantical changes !=0A= =0A= Signed-off-by: Vineet Gupta =0A= ---=0A= mm/pgtable-generic.c | 50 +++++++++++++++++++++++++-----------------------= --=0A= 1 file changed, 25 insertions(+), 25 deletions(-)=0A= =0A= diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c=0A= index 6b674e00153c..48851894e699 100644=0A= --- a/mm/pgtable-generic.c=0A= +++ b/mm/pgtable-generic.c=0A= @@ -57,6 +57,31 @@ int ptep_set_access_flags(struct vm_area_struct *vma,=0A= }=0A= #endif=0A= =0A= +#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH=0A= +int ptep_clear_flush_young(struct vm_area_struct *vma,=0A= + unsigned long address, pte_t *ptep)=0A= +{=0A= + int young;=0A= + young =3D ptep_test_and_clear_young(vma, address, ptep);=0A= + if (young)=0A= + flush_tlb_page(vma, address);=0A= + return young;=0A= +}=0A= +#endif=0A= +=0A= +#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH=0A= +pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,= =0A= + pte_t *ptep)=0A= +{=0A= + struct mm_struct *mm =3D (vma)->vm_mm;=0A= + pte_t pte;=0A= + pte =3D ptep_get_and_clear(mm, address, ptep);=0A= + if (pte_accessible(mm, pte))=0A= + flush_tlb_page(vma, address);=0A= + return pte;=0A= +}=0A= +#endif=0A= +=0A= #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS=0A= int pmdp_set_access_flags(struct vm_area_struct *vma,=0A= unsigned long address, pmd_t *pmdp,=0A= @@ -77,18 +102,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma,= =0A= }=0A= #endif=0A= =0A= -#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH=0A= -int ptep_clear_flush_young(struct vm_area_struct *vma,=0A= - unsigned long address, pte_t *ptep)=0A= -{=0A= - int young;=0A= - young =3D ptep_test_and_clear_young(vma, address, ptep);=0A= - if (young)=0A= - flush_tlb_page(vma, address);=0A= - return young;=0A= -}=0A= -#endif=0A= -=0A= #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH=0A= int pmdp_clear_flush_young(struct vm_area_struct *vma,=0A= unsigned long address, pmd_t *pmdp)=0A= @@ -106,19 +119,6 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma,= =0A= }=0A= #endif=0A= =0A= -#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH=0A= -pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,= =0A= - pte_t *ptep)=0A= -{=0A= - struct mm_struct *mm =3D (vma)->vm_mm;=0A= - pte_t pte;=0A= - pte =3D ptep_get_and_clear(mm, address, ptep);=0A= - if (pte_accessible(mm, pte))=0A= - flush_tlb_page(vma, address);=0A= - return pte;=0A= -}=0A= -#endif=0A= -=0A= #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH=0A= #ifdef CONFIG_TRANSPARENT_HUGEPAGE=0A= pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long addr= ess,=0A= -- =0A= 1.9.1=0A= =0A= -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by kanga.kvack.org (Postfix) with ESMTP id AB60182F65 for ; Fri, 9 Oct 2015 06:10:49 -0400 (EDT) Received: by wiclk2 with SMTP id lk2so60348562wic.1 for ; Fri, 09 Oct 2015 03:10:49 -0700 (PDT) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com. [209.85.212.174]) by mx.google.com with ESMTPS id p4si3504978wia.27.2015.10.09.03.10.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 03:10:48 -0700 (PDT) Received: by wiclk2 with SMTP id lk2so60348134wic.1 for ; Fri, 09 Oct 2015 03:10:48 -0700 (PDT) Date: Fri, 9 Oct 2015 13:10:46 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH v2 00/12] THP support for ARC Message-ID: <20151009101046.GA8081@node> References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <560CCC73.9080705@synopsys.com> <561789E6.9090800@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <561789E6.9090800@synopsys.com> Sender: owner-linux-mm@kvack.org List-ID: To: Vineet Gupta Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org On Fri, Oct 09, 2015 at 03:03:26PM +0530, Vineet Gupta wrote: > On Thursday 01 October 2015 11:32 AM, Vineet Gupta wrote: > > On Tuesday 22 September 2015 04:04 PM, Vineet Gupta wrote: > >> > Hi, > >> > > >> > This series brings THP support to ARC. It also introduces an optional new > >> > thp hook for arches to possibly optimize the TLB flush in thp regime. > >> > > >> > Please review ! > >> > > >> > Changes Since v1 [*] > >> > - Rebased against v4.3-rc2 > >> > - Switched ARC pgtable_t to pte_t * (Kiril) > >> > - Removed stub implementations for (Andrew) > >> > pmdp_set_access_flags, pmdp_test_and_clear_young, pmdp_set_wrprotect, > >> > pmdp_collapse_flush, pmd_same > >> > > >> > [*] http://lkml.kernel.org/r/1440666194-21478-1-git-send-email-vgupta@synopsys.com > >> > > >> > Vineet Gupta (12): > >> > ARC: mm: switch pgtable_to to pte_t * > >> > ARC: mm: pte flags comsetic cleanups, comments > >> > ARC: mm: Introduce PTE_SPECIAL > >> > Documentation/features/vm: pte_special now supported by ARC > >> > ARCv2: mm: THP support > >> > ARCv2: mm: THP: boot validation/reporting > >> > Documentation/features/vm: THP now supported by ARC > >> > mm: move some code around > >> > mm,thp: reduce ifdef'ery for THP in generic code > >> > mm,thp: introduce flush_pmd_tlb_range > >> > ARCv2: mm: THP: Implement flush_pmd_tlb_range() optimization > >> > ARCv2: Add a DT which enables THP > >> > > >> > Documentation/features/vm/THP/arch-support.txt | 2 +- > >> > .../features/vm/pte_special/arch-support.txt | 2 +- > >> > arch/arc/Kconfig | 4 + > >> > arch/arc/boot/dts/hs_thp.dts | 59 +++++++++++++ > >> > arch/arc/include/asm/hugepage.h | 82 ++++++++++++++++++ > >> > arch/arc/include/asm/page.h | 5 +- > >> > arch/arc/include/asm/pgalloc.h | 6 +- > >> > arch/arc/include/asm/pgtable.h | 60 +++++++------ > >> > arch/arc/mm/tlb.c | 76 ++++++++++++++++- > >> > arch/arc/mm/tlbex.S | 21 +++-- > >> > include/asm-generic/pgtable.h | 49 ++++------- > >> > mm/huge_memory.c | 2 +- > >> > mm/pgtable-generic.c | 99 ++++++++++------------ > >> > 13 files changed, 345 insertions(+), 122 deletions(-) > >> > create mode 100644 arch/arc/boot/dts/hs_thp.dts > >> > create mode 100644 arch/arc/include/asm/hugepage.h > > Andrew, Kirill, could you please review/ack the generic mm bits atleast so I can > > proceed with moving the stuff into linux-next ! > > Ping 2 ! Sorry. > Can I please get some acks on the generic mm bits. Some of the changes > will likely collide Kirill's THP rework ! Could you check if it acctually collides? > Given people rebase off of mmtomm would it be better if generic patches went thru > Andrew and probably included sooner for 4.4 target ? > > -Vineet > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) by kanga.kvack.org (Postfix) with ESMTP id D1C096B0253 for ; Fri, 9 Oct 2015 06:54:53 -0400 (EDT) Received: by igbkq10 with SMTP id kq10so32530372igb.0 for ; Fri, 09 Oct 2015 03:54:53 -0700 (PDT) Received: from smtprelay.synopsys.com (smtprelay.synopsys.com. [198.182.47.9]) by mx.google.com with ESMTPS id m2si10557748igr.10.2015.10.09.03.54.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 03:54:53 -0700 (PDT) Subject: Re: [PATCH v2 10/12] mm,thp: introduce flush_pmd_tlb_range References: <1442918096-17454-1-git-send-email-vgupta@synopsys.com> <1442918096-17454-11-git-send-email-vgupta@synopsys.com> <20151009100816.GC7873@node> From: Vineet Gupta Message-ID: <56179CE5.5000807@synopsys.com> Date: Fri, 9 Oct 2015 16:24:29 +0530 MIME-Version: 1.0 In-Reply-To: <20151009100816.GC7873@node> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: Andrew Morton , "Aneesh Kumar K.V" , "Kirill A. Shutemov" , Mel Gorman , Matthew Wilcox , Minchan Kim , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org On Friday 09 October 2015 03:38 PM, Kirill A. Shutemov wrote: > On Tue, Sep 22, 2015 at 04:04:54PM +0530, Vineet Gupta wrote: > > Commit message: -ENOENT. > > Otherwise, looks good: > > Acked-by: Kirill A. Shutemov With updated change log and some reworking in the source code comment ! ---------------->