[RFC 0/2] Potential race condition with page lock

2019-02-11 Thread Chintan Pandya
cking if it is really locked or not as there are explicit APIs to set PG_locked. I didn't get traces of history for having PG_locked being set non-atomically. I believe it could be because of performance reasons. Not sure though. Chintan Pandya (2): page-flags: Make page lock operation ato

[RFC 1/2] page-flags: Make page lock operation atomic

2019-02-11 Thread Chintan Pandya
ge-Id: I13bdbedc2b198af014d885e1925c93b83ed6660e Signed-off-by: Chintan Pandya --- fs/cifs/file.c | 8 fs/pipe.c | 2 +- include/linux/page-flags.h | 2 +- include/linux/pagemap.h| 6 +++--- mm/filemap.c | 4 ++-- mm/khugepaged.c| 2 +- mm/

[RFC 2/2] page-flags: Catch the double setter of page flags

2019-02-11 Thread Chintan Pandya
wait-until-set. So, at least, find out who is doing double setting and fix them. Change-Id: I1295fcb8527ce4b54d5d11c11287fc7516006cf0 Signed-off-by: Chintan Pandya --- include/linux/page-flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/page-flags.h b/include

[tip:x86/mm] ioremap: Update pgtable free interfaces with addr

2018-07-04 Thread tip-bot for Chintan Pandya
Commit-ID: 785a19f9d1dd8a4ab2d0633be4656653bd3de1fc Gitweb: https://git.kernel.org/tip/785a19f9d1dd8a4ab2d0633be4656653bd3de1fc Author: Chintan Pandya AuthorDate: Wed, 27 Jun 2018 08:13:47 -0600 Committer: Thomas Gleixner CommitDate: Wed, 4 Jul 2018 21:37:08 +0200 ioremap: Update

Re: [PATCH v13 0/3] Fix issues with huge mapping in ioremap for ARM64

2018-06-11 Thread Chintan Pandya
Hi Andrew, On 6/6/2018 9:15 PM, Will Deacon wrote: [...] On Wed, Jun 06, 2018 at 12:31:18PM +0530, Chintan Pandya wrote: This series of patches re-bring huge vmap back for arm64. Patch 1/3 has been taken by Toshi in his series of patches by name "[PATCH v3 0/3] fix free pmd/pte

Re: [PATCH v13 0/3] Fix issues with huge mapping in ioremap for ARM64

2018-06-07 Thread Chintan Pandya
On 6/6/2018 9:15 PM, Will Deacon wrote: Hi Chintan, Hi Will, Thanks for sticking with this. I've reviewed the series now and I'm keen for it to land in mainline. Just a couple of things below. Thanks for all the reviews so far. On Wed, Jun 06, 2018 at 12:31:18PM +0530, Chin

[PATCH v13 2/3] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-06-06 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index dfc61d7

[PATCH v13 1/3] ioremap: Update pgtable free interfaces with addr

2018-06-06 Thread Chintan Pandya
From: Chintan Pandya The following kernel panic was observed on ARM64 platform due to a stale TLB entry. 1. ioremap with 4K size, a valid pte page table is set. 2. iounmap it, its pte entry is set to 0. 3. ioremap the same address with 2M size, update its pmd entry with a new value. 4

[PATCH v13 3/3] arm64: Implement page table free interfaces

2018-06-06 Thread Chintan Pandya
and also free the leaking page tables. Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidation of TLB 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 48 1 file

[PATCH v13 0/3] Fix issues with huge mapping in ioremap for ARM64

2018-06-06 Thread Chintan Pandya
one perticular case >From V2->V3: - Use the exisiting page table free interface to do arm64 specific things >From V1->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmapped page table" - Honored BBM for ARM64 Chintan Pandy

Re: [PATCH v12 3/5] arm64: pgtable: Add p*d_page_vaddr helper macros

2018-06-04 Thread Chintan Pandya
On 6/4/2018 5:43 PM, Will Deacon wrote: On Fri, Jun 01, 2018 at 06:09:16PM +0530, Chintan Pandya wrote: Add helper macros to give virtual references to page tables. These will be used while freeing dangling page tables. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/pgtable.h

Re: [PATCH v12 5/5] arm64: Allow huge io mappings again

2018-06-04 Thread Chintan Pandya
On 6/4/2018 5:44 PM, Will Deacon wrote: On Fri, Jun 01, 2018 at 06:09:18PM +0530, Chintan Pandya wrote: Huge mappings have had stability issues due to stale TLB entry and memory leak issues. Since, those are addressed in this series of patches, it is now safe to allow huge mappings. Signed

Re: [PATCH v12 4/5] arm64: Implement page table free interfaces

2018-06-04 Thread Chintan Pandya
On 6/4/2018 5:43 PM, Will Deacon wrote: On Fri, Jun 01, 2018 at 06:09:17PM +0530, Chintan Pandya wrote: Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but

Re: [PATCH v12 0/5] Fix issues with huge mapping in ioremap for ARM64

2018-06-03 Thread Chintan Pandya
d enough. Test ended positively. Thanks, On 6/1/2018 6:09 PM, Chintan Pandya wrote: This series of patches re-bring huge vmap back for arm64. Patch 1/4 has been taken by Toshi in his series of patches by name "[PATCH v3 0/3] fix free pmd/pte page handlings on x86" to avoid merge conflict wi

[PATCH v12 3/5] arm64: pgtable: Add p*d_page_vaddr helper macros

2018-06-01 Thread Chintan Pandya
Add helper macros to give virtual references to page tables. These will be used while freeing dangling page tables. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/pgtable.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm

[PATCH v12 1/5] ioremap: Update pgtable free interfaces with addr

2018-06-01 Thread Chintan Pandya
From: Chintan Pandya The following kernel panic was observed on ARM64 platform due to a stale TLB entry. 1. ioremap with 4K size, a valid pte page table is set. 2. iounmap it, its pte entry is set to 0. 3. ioremap the same address with 2M size, update its pmd entry with a new value. 4

[PATCH v12 2/5] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-06-01 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index dfc61d7

[PATCH v12 4/5] arm64: Implement page table free interfaces

2018-06-01 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v12 0/5] Fix issues with huge mapping in ioremap for ARM64

2018-06-01 Thread Chintan Pandya
and table free - Avoid redundant TLB invalidatation in one perticular case >From V2->V3: - Use the exisiting page table free interface to do arm64 specific things >From V1->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmappe

[PATCH v12 5/5] arm64: Allow huge io mappings again

2018-06-01 Thread Chintan Pandya
Huge mappings have had stability issues due to stale TLB entry and memory leak issues. Since, those are addressed in this series of patches, it is now safe to allow huge mappings. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 18 ++ 1 file changed, 2 insertions(+), 16

[PATCH v11 3/4] arm64: Implement page table free interfaces

2018-05-25 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v11 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-05-25 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index dfc61d7

[PATCH v11 1/4] ioremap: Update pgtable free interfaces with addr

2018-05-25 Thread Chintan Pandya
From: Chintan Pandya The following kernel panic was observed on ARM64 platform due to a stale TLB entry. 1. ioremap with 4K size, a valid pte page table is set. 2. iounmap it, its pte entry is set to 0. 3. ioremap the same address with 2M size, update its pmd entry with a new value. 4

[PATCH v11 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-05-25 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v11 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-05-25 Thread Chintan Pandya
ne perticular case >From V2->V3: - Use the exisiting page table free interface to do arm64 specific things >From V1->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmapped page table" - Honored BBM for ARM64 Chintan Pandya

Re: [PATCH v10 3/4] arm64: Implement page table free interfaces

2018-05-24 Thread Chintan Pandya
On 5/24/2018 7:27 PM, Chintan Pandya wrote: Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page

[PATCH v10 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-05-24 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v10 1/4] ioremap: Update pgtable free interfaces with addr

2018-05-24 Thread Chintan Pandya
From: Chintan Pandya The following kernel panic was observed on ARM64 platform due to a stale TLB entry. 1. ioremap with 4K size, a valid pte page table is set. 2. iounmap it, its pte entry is set to 0. 3. ioremap the same address with 2M size, update its pmd entry with a new value. 4

[PATCH v10 3/4] arm64: Implement page table free interfaces

2018-05-24 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v10 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-05-24 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index dfc61d7

[PATCH v10 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-05-24 Thread Chintan Pandya
for 'addr' in x86 implementation - Re-order pmd/pud clear and table free - Avoid redundant TLB invalidatation in one perticular case >From V2->V3: - Use the exisiting page table free interface to do arm64 specific things >From V1->V2: - Rebased my patches on top of &

Re: [PATCH v9 3/4] arm64: Implement page table free interfaces

2018-05-24 Thread Chintan Pandya
/4 as updated by Toshi. On Mon, Apr 30, 2018 at 01:11:33PM +0530, Chintan Pandya wrote: Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entr

Re: [PATCH v9 3/4] arm64: Implement page table free interfaces

2018-05-24 Thread Chintan Pandya
On 5/23/2018 8:04 PM, Kani, Toshi wrote: On Wed, 2018-05-23 at 15:01 +0100, Will Deacon wrote: Hi Chintan, [as a side note: I'm confused on the status of this patch series, as part of it was reposted separately by Toshi. Please can you work together?] I do not know the status of my patch

Re: [PATCH v2 2/2] mm: vmalloc: Pass proper vm_start into debugobjects

2018-05-03 Thread Chintan Pandya
On 5/4/2018 3:12 AM, Andrew Morton wrote: On Tue, 17 Apr 2018 16:13:48 +0530 Chintan Pandya wrote: Client can call vunmap with some intermediate 'addr' which may not be the start of the VM area. Entire unmap code works with vm->vm_start which is proper but debug object API i

Re: [PATCH 1/2] arm64/mm: define ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT

2018-05-03 Thread Chintan Pandya
On 5/2/2018 1:24 PM, Ganesh Mahendran wrote: Set ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT for arm64. This enables Speculative Page Fault handler. Signed-off-by: Ganesh Mahendran --- This patch is on top of Laurent's v10 spf --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --g

[PATCH v3] mm: vmalloc: Clean up vunmap to avoid pgtable ops twice

2018-05-01 Thread Chintan Pandya
) + 45.468 us |} 6) 2.760 us|vunmap_page_range(); 6) ! 505.105 us | } Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ebff729..781ce02 100644 --- a

Re: [PATCH v2] mm: vmalloc: Clean up vunmap to avoid pgtable ops twice

2018-04-30 Thread Chintan Pandya
On 5/1/2018 4:22 AM, Andrew Morton wrote: On Mon, 16 Apr 2018 16:29:02 +0530 Chintan Pandya wrote: vunmap does page table clear operations twice in the case when DEBUG_PAGEALLOC_ENABLE_DEFAULT is enabled. So, clean up the code as that is unintended. As a perf gain, we save few us. Below

Re: [PATCH v2 2/2] mm: vmalloc: Pass proper vm_start into debugobjects

2018-04-30 Thread Chintan Pandya
On 5/1/2018 4:34 AM, Andrew Morton wrote: should check for it and do a WARN_ONCE so it gets fixed. Yes, that was an idea in discussion but I've been suggested that it could be intentional. But since you are raising this, I will try to dig once again and share a patch with WARN_ONCE if passing

[PATCH v9 3/4] arm64: Implement page table free interfaces

2018-04-30 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v9 1/4] ioremap: Update pgtable free interfaces with addr

2018-04-30 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 4 ++-- arch/x86/mm/pgtable.c | 8 +---

[PATCH v9 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-04-30 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v9 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-04-30 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index dfc61d7

[PATCH v9 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-04-30 Thread Chintan Pandya
specific things >From V1->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmapped page table" - Honored BBM for ARM64 Chintan Pandya (4): ioremap: Update pgtable free interfaces with addr arm64: tlbflush: Introduce __flush_tlb_kernel_pgt

Re: [PATCH v2 2/2] x86/mm: implement free pmd/pte page interfaces

2018-04-30 Thread Chintan Pandya
On 4/29/2018 2:24 AM, Kani, Toshi wrote: On Sat, 2018-04-28 at 11:02 +0200, j...@8bytes.org wrote: On Fri, Apr 27, 2018 at 02:31:51PM +, Kani, Toshi wrote: So, we can add the step 2 on top of this patch. 1. Clear pud/pmd entry. 2. System wide TLB flush <-- TO BE ADDED BY NEW PATCH 3

Re: [PATCH v2 2/2] x86/mm: implement free pmd/pte page interfaces

2018-04-27 Thread Chintan Pandya
On 4/27/2018 6:18 PM, j...@8bytes.org wrote: On Fri, Apr 27, 2018 at 05:22:28PM +0530, Chintan Pandya wrote: I'm bit confused here. Are you pointing to race within ioremap/vmalloc framework while updating the page table or race during tlb ops. Since later is arch dependent, I woul

Re: [PATCH v8 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-04-27 Thread Chintan Pandya
On 4/27/2018 3:59 PM, Catalin Marinas wrote: On Tue, Apr 03, 2018 at 01:30:44PM +0530, Chintan Pandya wrote: Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 6 ++ 1 file changed, 6

Re: [PATCH v2 2/2] x86/mm: implement free pmd/pte page interfaces

2018-04-27 Thread Chintan Pandya
On 4/27/2018 1:07 PM, j...@8bytes.org wrote: On Thu, Apr 26, 2018 at 10:30:14PM +, Kani, Toshi wrote: Thanks for the clarification. After reading through SDM one more time, I agree that we need a TLB purge here. Here is my current understanding. - INVLPG purges both TLB and paging-struc

[PATCH v2 1/2] mm: vmalloc: Avoid racy handling of debugobjects in vunmap

2018-04-17 Thread Chintan Pandya
the debug objects corresponding to this vm area. Here, we actually free 'other' client's debug objects. Fix this by freeing the debug objects first and then releasing the VM area. Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-

[PATCH v2 2/2] mm: vmalloc: Pass proper vm_start into debugobjects

2018-04-17 Thread Chintan Pandya
s into debug object API. Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 12d675c..033c918 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1124,15 +1124,15 @@ void vm_unmap_ram(const void *

[PATCH v2 0/2] vunmap and debug objects

2018-04-17 Thread Chintan Pandya
Below 2 patches are rebased over tip + my other patch in review "[PATCH v2] mm: vmalloc: Clean up vunmap to avoid pgtable ops twice" Chintan Pandya (2): mm: vmalloc: Avoid racy handling of debugobjects in vunmap mm: vmalloc: Pass proper vm_start into debugobjects >From V1->

Re: [PATCH v8 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-04-17 Thread Chintan Pandya
Ping... On 4/3/2018 1:30 PM, Chintan Pandya wrote: This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages". This series of patches are tested on 4.9 kernel with Cortex-A75 based SoC. These patches c

Re: [PATCH 2/2] mm: vmalloc: Pass proper vm_start into debugobjects

2018-04-16 Thread Chintan Pandya
On 4/17/2018 8:39 AM, Anshuman Khandual wrote: On 04/16/2018 05:39 PM, Chintan Pandya wrote: On 4/13/2018 5:31 PM, Anshuman Khandual wrote: On 04/13/2018 05:03 PM, Chintan Pandya wrote: Client can call vunmap with some intermediate 'addr' which may not be the start of the VM ar

Re: [PATCH 2/2] mm: vmalloc: Pass proper vm_start into debugobjects

2018-04-16 Thread Chintan Pandya
On 4/13/2018 5:31 PM, Anshuman Khandual wrote: On 04/13/2018 05:03 PM, Chintan Pandya wrote: Client can call vunmap with some intermediate 'addr' which may not be the start of the VM area. Entire unmap code works with vm->vm_start which is proper but debug object API is call

[PATCH v2] mm: vmalloc: Clean up vunmap to avoid pgtable ops twice

2018-04-16 Thread Chintan Pandya
) + 45.468 us |} 6) 2.760 us|vunmap_page_range(); 6) ! 505.105 us | } Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ebff729..6729400 100644 --- a/mm

Re: [PATCH] mm: vmalloc: Remove double execution of vunmap_page_range

2018-04-13 Thread Chintan Pandya
On 4/13/2018 5:11 PM, Michal Hocko wrote: On Fri 13-04-18 16:57:06, Chintan Pandya wrote: On 4/13/2018 4:39 PM, Michal Hocko wrote: On Fri 13-04-18 16:15:26, Chintan Pandya wrote: On 4/13/2018 4:10 PM, Anshuman Khandual wrote: On 04/13/2018 03:47 PM, Chintan Pandya wrote: On 4/13

[PATCH 2/2] mm: vmalloc: Pass proper vm_start into debugobjects

2018-04-13 Thread Chintan Pandya
s into debug object API. Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 9ff21a1..28034c55 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1526,8 +1526,8 @@ static void __vunmap(const void *addr

[PATCH 1/2] mm: vmalloc: Avoid racy handling of debugobjects in vunmap

2018-04-13 Thread Chintan Pandya
the debug objects corresponding to this vm area. Here, we actually free 'other' client's debug objects. Fix this by freeing the debug objects first and then releasing the VM area. Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-

[PATCH 0/2] vunmap and debug objects

2018-04-13 Thread Chintan Pandya
help debug objects to be in consistent state. We've observed some list corruptions in debug objects. However, no claims that these patches will be fixing them. If one has an opinion that debug object has no use in vmalloc framework, I would raise a patch to remove them from the vunmap leg. Ch

Re: [PATCH] mm: vmalloc: Remove double execution of vunmap_page_range

2018-04-13 Thread Chintan Pandya
On 4/13/2018 4:39 PM, Michal Hocko wrote: On Fri 13-04-18 16:15:26, Chintan Pandya wrote: On 4/13/2018 4:10 PM, Anshuman Khandual wrote: On 04/13/2018 03:47 PM, Chintan Pandya wrote: On 4/13/2018 3:29 PM, Anshuman Khandual wrote: On 04/13/2018 02:46 PM, Chintan Pandya wrote: Unmap

Re: [PATCH] mm: vmalloc: Remove double execution of vunmap_page_range

2018-04-13 Thread Chintan Pandya
On 4/13/2018 4:10 PM, Anshuman Khandual wrote: On 04/13/2018 03:47 PM, Chintan Pandya wrote: On 4/13/2018 3:29 PM, Anshuman Khandual wrote: On 04/13/2018 02:46 PM, Chintan Pandya wrote: Unmap legs do call vunmap_page_range() irrespective of debug_pagealloc_enabled() is enabled or not. So

Re: [PATCH] mm: vmalloc: Remove double execution of vunmap_page_range

2018-04-13 Thread Chintan Pandya
On 4/13/2018 3:29 PM, Anshuman Khandual wrote: On 04/13/2018 02:46 PM, Chintan Pandya wrote: Unmap legs do call vunmap_page_range() irrespective of debug_pagealloc_enabled() is enabled or not. So, remove redundant check and optional vunmap_page_range() routines. vunmap_page_range() tears

[PATCH] mm: vmalloc: Remove double execution of vunmap_page_range

2018-04-13 Thread Chintan Pandya
Unmap legs do call vunmap_page_range() irrespective of debug_pagealloc_enabled() is enabled or not. So, remove redundant check and optional vunmap_page_range() routines. Signed-off-by: Chintan Pandya --- mm/vmalloc.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions

Re: [PATCH v8 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-04-05 Thread Chintan Pandya
On 4/3/2018 5:25 PM, Chintan Pandya wrote: On 4/3/2018 2:13 PM, Marc Zyngier wrote: Hi Chintan, Hi Marc, On 03/04/18 09:00, Chintan Pandya wrote: This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages"

Re: [PATCH v8 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-04-03 Thread Chintan Pandya
On 4/3/2018 2:13 PM, Marc Zyngier wrote: Hi Chintan, Hi Marc, On 03/04/18 09:00, Chintan Pandya wrote: This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages". This series of patches are tested on

[PATCH v8 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-04-03 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index 9e82dd7

[PATCH v8 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-04-03 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v8 1/4] ioremap: Update pgtable free interfaces with addr

2018-04-03 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 4 ++-- arch/x86/mm/pgtable.c | 8 +---

[PATCH v8 3/4] arm64: Implement page table free interfaces

2018-04-03 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64

Re: [PATCH v7 1/4] ioremap: Update pgtable free interfaces with addr

2018-04-03 Thread Chintan Pandya
wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Chintan-Pandya/ioremap-Update-pgtable-free-interfaces-with-addr/20180329-133736 config: x86_64-rhel (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce

[PATCH v8 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-04-03 Thread Chintan Pandya
d redundant TLB invalidatation in one perticular case >From V2->V3: - Use the exisiting page table free interface to do arm64 specific things >From V1->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmapped page table" - Honor

[PATCH v7 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-03-28 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v7 3/4] arm64: Implement page table free interfaces

2018-03-28 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v7 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-03-28 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- arch/arm64/include/asm/tlbflush.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h index 9e82dd7

[PATCH v7 1/4] ioremap: Update pgtable free interfaces with addr

2018-03-28 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 4 ++-- arch/x86/mm/pgtable.c | 8 +---

[PATCH v7 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-03-28 Thread Chintan Pandya
;V3: - Use the exisiting page table free interface to do arm64 specific things >From V1->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmapped page table" - Honored BBM for ARM64 Chintan Pandya (4): ioremap: Update pgtable free inte

Re: [PATCH v5 1/4] ioremap: Update pgtable free interfaces with addr

2018-03-28 Thread Chintan Pandya
On 3/28/2018 5:20 PM, kbuild test robot wrote: @725 if (!pmd_free_pte_page(&pmd[i])) My bad ! Will fix this in v7 Chintan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative

Re: [PATCH v6 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-03-28 Thread Chintan Pandya
I goofed up in making a patch file so enumeration is wrong. I'll upload v7 On 3/28/2018 4:28 PM, Chintan Pandya wrote: This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages". This series of patch

[PATCH v6 1/4] ioremap: Update pgtable free interfaces with addr

2018-03-28 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- >From V4->V6: - No change arch/arm64/mm/mmu.c | 4 ++-- arch/x8

[PATCH v6 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-03-28 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- From: V1-> V6: - No change

[PATCH v6 1/2] arm64: Implement page table free interfaces

2018-03-28 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Clearing off the current pud/pmd entry 2) Invalidate TLB which could have previously valid but not stale entry 3) Freeing of the un-used next level page tables Signed-off-by: Chintan Pandya --- >From

[PATCH v6 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-03-28 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- From: V5->V6: - No change arch/arm64/include/asm/tlbflush.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/

[PATCH v6 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-03-28 Thread Chintan Pandya
->V2: - Rebased my patches on top of "[PATCH v2 1/2] mm/vmalloc: Add interfaces to free unmapped page table" - Honored BBM for ARM64 Chintan Pandya (4): ioremap: Update pgtable free interfaces with addr arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable arm64: Implement page table

Re: [PATCH v5 3/4] arm64: Implement page table free interfaces

2018-03-28 Thread Chintan Pandya
On 3/27/2018 11:30 PM, Will Deacon wrote: Hi Chintan, Hi Will, On Tue, Mar 27, 2018 at 06:54:59PM +0530, Chintan Pandya wrote: Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Freeing of the un-used next level page tables 2) Clearing off the current

[PATCH v5 1/4] ioremap: Update pgtable free interfaces with addr

2018-03-27 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- No change in v5. arch/arm64/mm/mmu.c | 4 ++-- arch/x86/mm/pgtable.c | 6

[PATCH v5 3/4] arm64: Implement page table free interfaces

2018-03-27 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Freeing of the un-used next level page tables 2) Clearing off the current pud/pmd entry 3) Invalidate TLB which could have previously valid but not stale entry Signed-off-by: Chintan Pandya --- V4->

[PATCH v5 4/4] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-03-27 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- No change in v5 arch/arm64/mm

[PATCH v5 2/4] arm64: tlbflush: Introduce __flush_tlb_kernel_pgtable

2018-03-27 Thread Chintan Pandya
Add an interface to invalidate intermediate page tables from TLB for kernel. Signed-off-by: Chintan Pandya --- Introduced in v5 arch/arm64/include/asm/tlbflush.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h

[PATCH v5 0/4] Fix issues with huge mapping in ioremap for ARM64

2018-03-27 Thread Chintan Pandya
This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages". This series of patches are tested on 4.9 kernel with Cortex-A75 based SoC. These patches can also go into '-stable' branch. Chintan Pand

Re: [PATCH v4 2/3] arm64: Implement page table free interfaces

2018-03-26 Thread Chintan Pandya
On 3/26/2018 3:25 PM, Mark Rutland wrote: On Tue, Mar 20, 2018 at 05:15:13PM +0530, Chintan Pandya wrote: +static int __pmd_free_pte_page(pmd_t *pmd, unsigned long addr, bool tlb_inv) +{ + pmd_t *table; + + if (pmd_val(*pmd)) { + table = __va(pmd_val(*pmd

[PATCH v4 2/3] arm64: Implement page table free interfaces

2018-03-20 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Freeing of the un-used next level page tables 2) Clearing off the current pud/pmd entry 3) Invalidate TLB which could have previously valid but not stale entry Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v4 1/3] ioremap: Update pgtable free interfaces with addr

2018-03-20 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 4 ++-- arch/x86/mm/pgtable.c | 6 -- include/a

[PATCH v4 3/3] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-03-20 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v4 0/3] Fix issues with huge mapping in ioremap for ARM64

2018-03-20 Thread Chintan Pandya
This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages". This series of patches are tested on 4.9 kernel with Cortex-A75 based SoC. Chintan Pandya (3): ioremap: Update pgtable free interfaces with addr a

Re: [PATCH v3 2/3] arm64: Implement page table free interfaces

2018-03-20 Thread Chintan Pandya
On 3/20/2018 12:59 AM, Kani, Toshi wrote: On Mon, 2018-03-19 at 18:10 +0530, Chintan Pandya wrote: Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Freeing of the un-used next level page tables 2) Clearing off the current pud/pmd entry 3) Invalidate

Re: [PATCH v3 1/3] ioremap: Update pgtable free interfaces with addr

2018-03-20 Thread Chintan Pandya
On 3/20/2018 12:31 AM, Kani, Toshi wrote: On Mon, 2018-03-19 at 18:10 +0530, Chintan Pandya wrote: This patch ("mm/vmalloc: Add interfaces to free unmapped page table") adds following 2 interfaces to free the page table in case we implement huge mapping. pud_free_pmd_

[PATCH v3 0/3] Fix issues with huge mapping in ioremap for ARM64

2018-03-19 Thread Chintan Pandya
This series of patches are follow up work (and depends on) Toshi Kani 's patches "fix memory leak/ panic in ioremap huge pages". This series of patches are tested on 4.9 kernel with Cortex-A75 based SoC. Chintan Pandya (3): ioremap: Update pgtable free interfaces with addr a

[PATCH v3 2/3] arm64: Implement page table free interfaces

2018-03-19 Thread Chintan Pandya
Implement pud_free_pmd_page() and pmd_free_pte_page(). Implementation requires, 1) Freeing of the un-used next level page tables 2) Clearing off the current pud/pmd entry 3) Invalidate TLB which could have previously valid but not stale entry Signed-off-by: Chintan Pandya --- arch/arm64

[PATCH v3 3/3] Revert "arm64: Enforce BBM for huge IO/VMAP mappings"

2018-03-19 Thread Chintan Pandya
This commit 15122ee2c515a ("arm64: Enforce BBM for huge IO/VMAP mappings") is a temporary work-around until the issues with CONFIG_HAVE_ARCH_HUGE_VMAP gets fixed. Revert this change as we have fixes for the issue. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 8 --

[PATCH v3 1/3] ioremap: Update pgtable free interfaces with addr

2018-03-19 Thread Chintan Pandya
pagetable entry even in map. Why ? Read this, https://patchwork.kernel.org/patch/10134581/ Pass 'addr' in these interfaces so that proper TLB ops can be performed. Signed-off-by: Chintan Pandya --- arch/arm64/mm/mmu.c | 4 ++-- arch/x86/mm/pgtable.c | 4 ++-- include/a

Re: [PATCH v2 3/4] arm64: Implement page table free interfaces

2018-03-18 Thread Chintan Pandya
On 3/15/2018 6:48 PM, Mark Rutland wrote: On Thu, Mar 15, 2018 at 06:15:05PM +0530, Chintan Pandya wrote: Implement pud_free_pmd_page() and pmd_free_pte_page(). Make sure, that they are indeed a page table before taking them to free. As mentioned on the prior patch, if the tables we&#x

  1   2   >