All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] mmthp-khugepaged-call-pte-flush-at-the-time-of-collapse.patch removed from -mm tree
@ 2016-02-16 18:49 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-02-16 18:49 UTC (permalink / raw)
  To: Vineet.Gupta1, aarcange, aneesh.kumar, kirill.shutemov, stable,
	vgupta, mm-commits


The patch titled
     Subject: mm,thp: khugepaged: call pte flush at the time of collapse
has been removed from the -mm tree.  Its filename was
     mmthp-khugepaged-call-pte-flush-at-the-time-of-collapse.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Subject: mm,thp: khugepaged: call pte flush at the time of collapse

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

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>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: <stable@vger.kernel.org>	[4.4]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/pgtable-generic.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN mm/pgtable-generic.c~mmthp-khugepaged-call-pte-flush-at-the-time-of-collapse mm/pgtable-generic.c
--- a/mm/pgtable-generic.c~mmthp-khugepaged-call-pte-flush-at-the-time-of-collapse
+++ a/mm/pgtable-generic.c
@@ -195,7 +195,9 @@ pmd_t pmdp_collapse_flush(struct vm_area
 	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
_

Patches currently in -mm which might be from Vineet.Gupta1@synopsys.com are

arc-thp-remove-infrastructure-for-handling-splitting-pmds.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-16 18:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16 18:49 [merged] mmthp-khugepaged-call-pte-flush-at-the-time-of-collapse.patch removed from -mm tree akpm

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.