Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1709524

Re: linux-next: manual merge of the akpm-current tree with the tip tree

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: linux-next: manual merge of the akpm-current tree with the tip tree
Date 2017-08-11 14:20 +0200
Message-ID <udh50-3qa-5@gated-at.bofh.it> (permalink)
References <udd1o-LV-17@gated-at.bofh.it> <udeAa-1Md-11@gated-at.bofh.it> <udgBZ-315-37@gated-at.bofh.it> <udgLE-34p-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 11, 2017 at 01:56:07PM +0200, Ingo Molnar wrote:
> I've done a minimal conflict resolution merge locally. Peter, could you please 
> double check my resolution, in:
> 
>   040cca3ab2f6: Merge branch 'linus' into locking/core, to resolve conflicts

That merge is a bit wonky, but not terminally broken afaict.

It now does two TLB flushes, the below cleans that up.

---
 mm/huge_memory.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ce883459e246..08f6c1993832 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1410,7 +1410,6 @@ int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t pmd)
 	unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
 	int page_nid = -1, this_nid = numa_node_id();
 	int target_nid, last_cpupid = -1;
-	bool need_flush = false;
 	bool page_locked;
 	bool migrated = false;
 	bool was_writable;
@@ -1497,22 +1496,18 @@ int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t pmd)
 	}
 
 	/*
-	 * The page_table_lock above provides a memory barrier
-	 * with change_protection_range.
-	 */
-	if (mm_tlb_flush_pending(vma->vm_mm))
-		flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
-
-	/*
 	 * Since we took the NUMA fault, we must have observed the !accessible
 	 * bit. Make sure all other CPUs agree with that, to avoid them
 	 * modifying the page we're about to migrate.
 	 *
 	 * Must be done under PTL such that we'll observe the relevant
-	 * set_tlb_flush_pending().
+	 * inc_tlb_flush_pending().
+	 *
+	 * We are not sure a pending tlb flush here is for a huge page
+	 * mapping or not. Hence use the tlb range variant
 	 */
 	if (mm_tlb_flush_pending(vma->vm_mm))
-		need_flush = true;
+		flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
 
 	/*
 	 * Migrate the THP to the requested node, returns with page unlocked
@@ -1520,13 +1515,6 @@ int do_huge_pmd_numa_page(struct vm_fault *vmf, pmd_t pmd)
 	 */
 	spin_unlock(vmf->ptl);
 
-	/*
-	 * We are not sure a pending tlb flush here is for a huge page
-	 * mapping or not. Hence use the tlb range variant
-	 */
-	if (need_flush)
-		flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE);
-
 	migrated = migrate_misplaced_transhuge_page(vma->vm_mm, vma,
 				vmf->pmd, pmd, vmf->address, page, target_nid);
 	if (migrated) {

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

linux-next: manual merge of the akpm-current tree with the tip tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-08-11 10:00 +0200
  Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 11:40 +0200
    Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 12:50 +0200
    Re: linux-next: manual merge of the akpm-current tree with the tip  tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-08-11 13:50 +0200
      Re: linux-next: manual merge of the akpm-current tree with the tip  tree Ingo Molnar <mingo@kernel.org> - 2017-08-11 14:00 +0200
        Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 14:20 +0200
          Re: linux-next: manual merge of the akpm-current tree with the tip  tree Ingo Molnar <mingo@kernel.org> - 2017-08-11 14:50 +0200
            Re: linux-next: manual merge of the akpm-current tree with the tip  tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-08-11 15:50 +0200
        Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 16:10 +0200
          Re: linux-next: manual merge of the akpm-current tree with the tip  tree Nadav Amit <namit@vmware.com> - 2017-08-13 08:10 +0200
            Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-13 15:00 +0200
              Re: linux-next: manual merge of the akpm-current tree with the tip  tree Minchan Kim <minchan@kernel.org> - 2017-08-14 05:20 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Nadav Amit <namit@vmware.com> - 2017-08-14 07:10 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Minchan Kim <minchan@kernel.org> - 2017-08-14 07:30 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Minchan Kim <minchan@kernel.org> - 2017-08-14 10:40 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-14 22:00 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Minchan Kim <minchan@kernel.org> - 2017-08-16 06:20 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-14 21:40 +0200
                Re: linux-next: manual merge of the akpm-current tree with the tip  tree Nadav Amit <namit@vmware.com> - 2017-08-15 10:00 +0200
          Re: linux-next: manual merge of the akpm-current tree with the tip  tree Minchan Kim <minchan@kernel.org> - 2017-08-14 05:10 +0200
            Re: linux-next: manual merge of the akpm-current tree with the tip  tree Peter Zijlstra <peterz@infradead.org> - 2017-08-14 21:00 +0200

csiph-web