All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  4:56 ` Vineet Gupta
  0 siblings, 0 replies; 13+ messages in thread
From: Vineet Gupta @ 2016-02-10  4:56 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Vineet Gupta, Aneesh Kumar K.V, Andrea Arcangeli, Andrew Morton,
	stable, linux-snps-arc, linux-kernel, linux-mm

This showed up on ARC when running LMBench bw_mem tests as
Overlapping TLB Machine Check Exception triggered due to STLB entry
(2M pages) overlapping some NTLB entry (regular 8K page).

bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
In the interim khugepaged kicks in, collapsing the contiguous ptes into
a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
flush out NTLB entries for the ptes. This for ARC (by design) can only
shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
with the subsequent STLB entry for collapsed page.
So make pmdp_collapse_flush() call pte flush interface not pmd flush.

Note that originally all thp flush call sites in generic code called
flush_tlb_range() leaving it to architecture to implement the flush for
pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
opt-in API flush_pmd_tlb_range() which made the semantics more explicit
but failed to distinguish the pte vs pmd flush in generic code, which is
what this patch fixes.

Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
by defining a ARC version, but that defeats the purpose of generic
version, plus sementically this is the right thing to do.

Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
exceptions with super pages

Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org> #4.4
Cc: <linux-snps-arc@lists.infradead.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 mm/pgtable-generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 7d3db0247983..1ba58213ad65 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
+
+	/* collapse entails shooting down ptes not pmd */
+	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
 	return pmd;
 }
 #endif
-- 
2.5.0

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  4:56 ` Vineet Gupta
  0 siblings, 0 replies; 13+ messages in thread
From: Vineet Gupta @ 2016-02-10  4:56 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Vineet Gupta, Aneesh Kumar K.V, Andrea Arcangeli, Andrew Morton,
	stable, linux-snps-arc, linux-kernel, linux-mm

This showed up on ARC when running LMBench bw_mem tests as
Overlapping TLB Machine Check Exception triggered due to STLB entry
(2M pages) overlapping some NTLB entry (regular 8K page).

bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
In the interim khugepaged kicks in, collapsing the contiguous ptes into
a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
flush out NTLB entries for the ptes. This for ARC (by design) can only
shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
with the subsequent STLB entry for collapsed page.
So make pmdp_collapse_flush() call pte flush interface not pmd flush.

Note that originally all thp flush call sites in generic code called
flush_tlb_range() leaving it to architecture to implement the flush for
pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
opt-in API flush_pmd_tlb_range() which made the semantics more explicit
but failed to distinguish the pte vs pmd flush in generic code, which is
what this patch fixes.

Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
by defining a ARC version, but that defeats the purpose of generic
version, plus sementically this is the right thing to do.

Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
exceptions with super pages

Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org> #4.4
Cc: <linux-snps-arc@lists.infradead.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 mm/pgtable-generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 7d3db0247983..1ba58213ad65 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
+
+	/* collapse entails shooting down ptes not pmd */
+	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
 	return pmd;
 }
 #endif
-- 
2.5.0

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  4:56 ` Vineet Gupta
  0 siblings, 0 replies; 13+ messages in thread
From: Vineet Gupta @ 2016-02-10  4:56 UTC (permalink / raw)
  To: linux-snps-arc

This showed up on ARC when running LMBench bw_mem tests as
Overlapping TLB Machine Check Exception triggered due to STLB entry
(2M pages) overlapping some NTLB entry (regular 8K page).

bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
In the interim khugepaged kicks in, collapsing the contiguous ptes into
a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
flush out NTLB entries for the ptes. This for ARC (by design) can only
shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
with the subsequent STLB entry for collapsed page.
So make pmdp_collapse_flush() call pte flush interface not pmd flush.

Note that originally all thp flush call sites in generic code called
flush_tlb_range() leaving it to architecture to implement the flush for
pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
opt-in API flush_pmd_tlb_range() which made the semantics more explicit
but failed to distinguish the pte vs pmd flush in generic code, which is
what this patch fixes.

Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
by defining a ARC version, but that defeats the purpose of generic
version, plus sementically this is the right thing to do.

Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
exceptions with super pages

Cc: Kirill A. Shutemov <kirill.shutemov at linux.intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange at redhat.com>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: <stable at vger.kernel.org> #4.4
Cc: <linux-snps-arc at lists.infradead.org>
Cc: linux-kernel at vger.kernel.org
Cc: linux-mm at kvack.org
Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
---
 mm/pgtable-generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 7d3db0247983..1ba58213ad65 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
+
+	/* collapse entails shooting down ptes not pmd */
+	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
 	return pmd;
 }
 #endif
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
  2016-02-10  4:56 ` Vineet Gupta
  (?)
  (?)
@ 2016-02-10  5:07   ` Aneesh Kumar K.V
  -1 siblings, 0 replies; 13+ messages in thread
From: Aneesh Kumar K.V @ 2016-02-10  5:07 UTC (permalink / raw)
  To: Vineet Gupta, Kirill A. Shutemov
  Cc: Vineet Gupta, Andrea Arcangeli, Andrew Morton, stable,
	linux-snps-arc, linux-kernel, linux-mm

Vineet Gupta <Vineet.Gupta1@synopsys.com> writes:

> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
>
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
>
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
>
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: <stable@vger.kernel.org> #4.4
> Cc: <linux-snps-arc@lists.infradead.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

We do have reverse usage in migration code path, which I have as a patch
here.

https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

> ---
>  mm/pgtable-generic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
> index 7d3db0247983..1ba58213ad65 100644
> --- a/mm/pgtable-generic.c
> +++ b/mm/pgtable-generic.c
> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
> +
> +	/* collapse entails shooting down ptes not pmd */
> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>  	return pmd;
>  }
>  #endif
> -- 
> 2.5.0

-aneesh

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  5:07   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 13+ messages in thread
From: Aneesh Kumar K.V @ 2016-02-10  5:07 UTC (permalink / raw)
  To: Vineet Gupta, Kirill A. Shutemov
  Cc: Vineet Gupta, Andrea Arcangeli, Andrew Morton, stable,
	linux-snps-arc, linux-kernel, linux-mm

Vineet Gupta <Vineet.Gupta1@synopsys.com> writes:

> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
>
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
>
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
>
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: <stable@vger.kernel.org> #4.4
> Cc: <linux-snps-arc@lists.infradead.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

We do have reverse usage in migration code path, which I have as a patch
here.

https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

> ---
>  mm/pgtable-generic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
> index 7d3db0247983..1ba58213ad65 100644
> --- a/mm/pgtable-generic.c
> +++ b/mm/pgtable-generic.c
> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
> +
> +	/* collapse entails shooting down ptes not pmd */
> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>  	return pmd;
>  }
>  #endif
> -- 
> 2.5.0

-aneesh

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  5:07   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 13+ messages in thread
From: Aneesh Kumar K.V @ 2016-02-10  5:07 UTC (permalink / raw)
  To: Vineet Gupta, Kirill A. Shutemov
  Cc: Andrea Arcangeli, Andrew Morton, stable, linux-snps-arc,
	linux-kernel, linux-mm

Vineet Gupta <Vineet.Gupta1@synopsys.com> writes:

> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
>
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
>
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
>
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: <stable@vger.kernel.org> #4.4
> Cc: <linux-snps-arc@lists.infradead.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

We do have reverse usage in migration code path, which I have as a patch
here.

https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

> ---
>  mm/pgtable-generic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
> index 7d3db0247983..1ba58213ad65 100644
> --- a/mm/pgtable-generic.c
> +++ b/mm/pgtable-generic.c
> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
> +
> +	/* collapse entails shooting down ptes not pmd */
> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>  	return pmd;
>  }
>  #endif
> -- 
> 2.5.0

-aneesh

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] mm, thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  5:07   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 13+ messages in thread
From: Aneesh Kumar K.V @ 2016-02-10  5:07 UTC (permalink / raw)
  To: linux-snps-arc

Vineet Gupta <Vineet.Gupta1 at synopsys.com> writes:

> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
>
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
>
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
>
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
>
> Cc: Kirill A. Shutemov <kirill.shutemov at linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange at redhat.com>
> Cc: Andrew Morton <akpm at linux-foundation.org>
> Cc: <stable at vger.kernel.org> #4.4
> Cc: <linux-snps-arc at lists.infradead.org>
> Cc: linux-kernel at vger.kernel.org
> Cc: linux-mm at kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta at synopsys.com>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>

We do have reverse usage in migration code path, which I have as a patch
here.

https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

> ---
>  mm/pgtable-generic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
> index 7d3db0247983..1ba58213ad65 100644
> --- a/mm/pgtable-generic.c
> +++ b/mm/pgtable-generic.c
> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
> +
> +	/* collapse entails shooting down ptes not pmd */
> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>  	return pmd;
>  }
>  #endif
> -- 
> 2.5.0

-aneesh

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
  2016-02-10  5:07   ` Aneesh Kumar K.V
  (?)
@ 2016-02-10  5:15     ` Vineet Gupta
  -1 siblings, 0 replies; 13+ messages in thread
From: Vineet Gupta @ 2016-02-10  5:15 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Kirill A. Shutemov
  Cc: Andrea Arcangeli, Andrew Morton, stable, linux-snps-arc,
	linux-kernel, linux-mm

On Wednesday 10 February 2016 10:37 AM, Aneesh Kumar K.V wrote:
> Vineet Gupta <Vineet.Gupta1@synopsys.com> writes:
> 
>> This showed up on ARC when running LMBench bw_mem tests as
>> Overlapping TLB Machine Check Exception triggered due to STLB entry
>> (2M pages) overlapping some NTLB entry (regular 8K page).
>>
>> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
>> In the interim khugepaged kicks in, collapsing the contiguous ptes into
>> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
>> flush out NTLB entries for the ptes. This for ARC (by design) can only
>> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
>> with the subsequent STLB entry for collapsed page.
>> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>>
>> Note that originally all thp flush call sites in generic code called
>> flush_tlb_range() leaving it to architecture to implement the flush for
>> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
>> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
>> but failed to distinguish the pte vs pmd flush in generic code, which is
>> what this patch fixes.
>>
>> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
>> by defining a ARC version, but that defeats the purpose of generic
>> version, plus sementically this is the right thing to do.
>>
>> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
>> exceptions with super pages
>>
>> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: <stable@vger.kernel.org> #4.4
>> Cc: <linux-snps-arc@lists.infradead.org>
>> Cc: linux-kernel@vger.kernel.org
>> Cc: linux-mm@kvack.org
>> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> 
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

I hope that there is no other site which needs similar fixup.


> We do have reverse usage in migration code path, which I have as a patch
> here.
> 
> https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

Great ! So you must also be defining __HAVE_ARCH_FLUSH_PMD_TLB_RANGE for powerpc.
What branch is that patch off of ?

> 
>> ---
>>  mm/pgtable-generic.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
>> index 7d3db0247983..1ba58213ad65 100644
>> --- a/mm/pgtable-generic.c
>> +++ b/mm/pgtable-generic.c
>> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>> +
>> +	/* collapse entails shooting down ptes not pmd */
>> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>>  	return pmd;
>>  }
>>  #endif
>> -- 
>> 2.5.0
> 
> -aneesh
> 
> --
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  5:15     ` Vineet Gupta
  0 siblings, 0 replies; 13+ messages in thread
From: Vineet Gupta @ 2016-02-10  5:15 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Kirill A. Shutemov
  Cc: Andrea Arcangeli, Andrew Morton, stable, linux-snps-arc,
	linux-kernel, linux-mm

On Wednesday 10 February 2016 10:37 AM, Aneesh Kumar K.V wrote:
> Vineet Gupta <Vineet.Gupta1@synopsys.com> writes:
> 
>> This showed up on ARC when running LMBench bw_mem tests as
>> Overlapping TLB Machine Check Exception triggered due to STLB entry
>> (2M pages) overlapping some NTLB entry (regular 8K page).
>>
>> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
>> In the interim khugepaged kicks in, collapsing the contiguous ptes into
>> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
>> flush out NTLB entries for the ptes. This for ARC (by design) can only
>> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
>> with the subsequent STLB entry for collapsed page.
>> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>>
>> Note that originally all thp flush call sites in generic code called
>> flush_tlb_range() leaving it to architecture to implement the flush for
>> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
>> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
>> but failed to distinguish the pte vs pmd flush in generic code, which is
>> what this patch fixes.
>>
>> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
>> by defining a ARC version, but that defeats the purpose of generic
>> version, plus sementically this is the right thing to do.
>>
>> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
>> exceptions with super pages
>>
>> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: <stable@vger.kernel.org> #4.4
>> Cc: <linux-snps-arc@lists.infradead.org>
>> Cc: linux-kernel@vger.kernel.org
>> Cc: linux-mm@kvack.org
>> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> 
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

I hope that there is no other site which needs similar fixup.


> We do have reverse usage in migration code path, which I have as a patch
> here.
> 
> https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

Great ! So you must also be defining __HAVE_ARCH_FLUSH_PMD_TLB_RANGE for powerpc.
What branch is that patch off of ?

> 
>> ---
>>  mm/pgtable-generic.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
>> index 7d3db0247983..1ba58213ad65 100644
>> --- a/mm/pgtable-generic.c
>> +++ b/mm/pgtable-generic.c
>> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>> +
>> +	/* collapse entails shooting down ptes not pmd */
>> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>>  	return pmd;
>>  }
>>  #endif
>> -- 
>> 2.5.0
> 
> -aneesh
> 
> --
> 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10  5:15     ` Vineet Gupta
  0 siblings, 0 replies; 13+ messages in thread
From: Vineet Gupta @ 2016-02-10  5:15 UTC (permalink / raw)
  To: linux-snps-arc

On Wednesday 10 February 2016 10:37 AM, Aneesh Kumar K.V wrote:
> Vineet Gupta <Vineet.Gupta1 at synopsys.com> writes:
> 
>> This showed up on ARC when running LMBench bw_mem tests as
>> Overlapping TLB Machine Check Exception triggered due to STLB entry
>> (2M pages) overlapping some NTLB entry (regular 8K page).
>>
>> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
>> In the interim khugepaged kicks in, collapsing the contiguous ptes into
>> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
>> flush out NTLB entries for the ptes. This for ARC (by design) can only
>> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
>> with the subsequent STLB entry for collapsed page.
>> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
>>
>> Note that originally all thp flush call sites in generic code called
>> flush_tlb_range() leaving it to architecture to implement the flush for
>> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
>> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
>> but failed to distinguish the pte vs pmd flush in generic code, which is
>> what this patch fixes.
>>
>> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
>> by defining a ARC version, but that defeats the purpose of generic
>> version, plus sementically this is the right thing to do.
>>
>> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
>> exceptions with super pages
>>
>> Cc: Kirill A. Shutemov <kirill.shutemov at linux.intel.com>
>> Cc: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
>> Cc: Andrea Arcangeli <aarcange at redhat.com>
>> Cc: Andrew Morton <akpm at linux-foundation.org>
>> Cc: <stable at vger.kernel.org> #4.4
>> Cc: <linux-snps-arc at lists.infradead.org>
>> Cc: linux-kernel at vger.kernel.org
>> Cc: linux-mm at kvack.org
>> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
>> Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
> 
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>

I hope that there is no other site which needs similar fixup.


> We do have reverse usage in migration code path, which I have as a patch
> here.
> 
> https://github.com/kvaneesh/linux/commit/b8a78933fea93cb0b2978868e59a0a4b12eb92eb

Great ! So you must also be defining __HAVE_ARCH_FLUSH_PMD_TLB_RANGE for powerpc.
What branch is that patch off of ?

> 
>> ---
>>  mm/pgtable-generic.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
>> index 7d3db0247983..1ba58213ad65 100644
>> --- a/mm/pgtable-generic.c
>> +++ b/mm/pgtable-generic.c
>> @@ -210,7 +210,9 @@ 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_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>> +
>> +	/* collapse entails shooting down ptes not pmd */
>> +	flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
>>  	return pmd;
>>  }
>>  #endif
>> -- 
>> 2.5.0
> 
> -aneesh
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo at kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont at kvack.org"> email at kvack.org </a>
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
  2016-02-10  4:56 ` Vineet Gupta
  (?)
@ 2016-02-10 10:50   ` Kirill A. Shutemov
  -1 siblings, 0 replies; 13+ messages in thread
From: Kirill A. Shutemov @ 2016-02-10 10:50 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Kirill A. Shutemov, Aneesh Kumar K.V, Andrea Arcangeli,
	Andrew Morton, stable, linux-snps-arc, linux-kernel, linux-mm

On Wed, Feb 10, 2016 at 10:26:15AM +0530, Vineet Gupta wrote:
> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
> 
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
> 
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
> 
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
> 
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
> 
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: <stable@vger.kernel.org> #4.4
> Cc: <linux-snps-arc@lists.infradead.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10 10:50   ` Kirill A. Shutemov
  0 siblings, 0 replies; 13+ messages in thread
From: Kirill A. Shutemov @ 2016-02-10 10:50 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Kirill A. Shutemov, Aneesh Kumar K.V, Andrea Arcangeli,
	Andrew Morton, stable, linux-snps-arc, linux-kernel, linux-mm

On Wed, Feb 10, 2016 at 10:26:15AM +0530, Vineet Gupta wrote:
> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
> 
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
> 
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
> 
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
> 
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
> 
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: <stable@vger.kernel.org> #4.4
> Cc: <linux-snps-arc@lists.infradead.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse
@ 2016-02-10 10:50   ` Kirill A. Shutemov
  0 siblings, 0 replies; 13+ messages in thread
From: Kirill A. Shutemov @ 2016-02-10 10:50 UTC (permalink / raw)
  To: linux-snps-arc

On Wed, Feb 10, 2016@10:26:15AM +0530, Vineet Gupta wrote:
> This showed up on ARC when running LMBench bw_mem tests as
> Overlapping TLB Machine Check Exception triggered due to STLB entry
> (2M pages) overlapping some NTLB entry (regular 8K page).
> 
> bw_mem 2m touches a large chunk of vaddr creating NTLB entries.
> In the interim khugepaged kicks in, collapsing the contiguous ptes into
> a single pmd. pmdp_collapse_flush()->flush_pmd_tlb_range() is called to
> flush out NTLB entries for the ptes. This for ARC (by design) can only
> shootdown STLB entries (for pmd). The stray NTLB entries cause the overlap
> with the subsequent STLB entry for collapsed page.
> So make pmdp_collapse_flush() call pte flush interface not pmd flush.
> 
> Note that originally all thp flush call sites in generic code called
> flush_tlb_range() leaving it to architecture to implement the flush for
> pte and/or pmd. Commit 12ebc1581ad11454 changed this by calling a new
> opt-in API flush_pmd_tlb_range() which made the semantics more explicit
> but failed to distinguish the pte vs pmd flush in generic code, which is
> what this patch fixes.
> 
> Note that ARC can fixed w/o touching the generic pmdp_collapse_flush()
> by defining a ARC version, but that defeats the purpose of generic
> version, plus sementically this is the right thing to do.
> 
> Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB
> exceptions with super pages
> 
> Cc: Kirill A. Shutemov <kirill.shutemov at linux.intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
> Cc: Andrea Arcangeli <aarcange at redhat.com>
> Cc: Andrew Morton <akpm at linux-foundation.org>
> Cc: <stable at vger.kernel.org> #4.4
> Cc: <linux-snps-arc at lists.infradead.org>
> Cc: linux-kernel at vger.kernel.org
> Cc: linux-mm at kvack.org
> Fixes: 12ebc1581ad11454 ("mm,thp: introduce flush_pmd_tlb_range")
> Signed-off-by: Vineet Gupta <vgupta at synopsys.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov at linux.intel.com>

-- 
 Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-02-10 10:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10  4:56 [PATCH] mm,thp: khugepaged: call pte flush at the time of collapse Vineet Gupta
2016-02-10  4:56 ` Vineet Gupta
2016-02-10  4:56 ` Vineet Gupta
2016-02-10  5:07 ` Aneesh Kumar K.V
2016-02-10  5:07   ` [PATCH] mm, thp: " Aneesh Kumar K.V
2016-02-10  5:07   ` [PATCH] mm,thp: " Aneesh Kumar K.V
2016-02-10  5:07   ` Aneesh Kumar K.V
2016-02-10  5:15   ` Vineet Gupta
2016-02-10  5:15     ` Vineet Gupta
2016-02-10  5:15     ` Vineet Gupta
2016-02-10 10:50 ` Kirill A. Shutemov
2016-02-10 10:50   ` Kirill A. Shutemov
2016-02-10 10:50   ` Kirill A. Shutemov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.