Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2018-11-02 19:02:20 +0100
committerMichal Hocko <mhocko@suse.com>2018-11-02 19:02:20 +0100
commitaebbc81fc0e26081a7e210c04da9edbefaba8fc6 (patch)
tree1866e9fc9fb5757c28c1759e7c55e36e5b9d4305
parent0a3d586375ce6105a61ccdebad707c9b1498b41f (diff)
parentf536f14508370bf61e28d3e49cf0a9b56bc77ab3 (diff)
Merge remote-tracking branch 'origin/cve/linux-3.0' into users/mhocko/SLE11-SP4/for-nextrpm-3.0.101-108.81
-rw-r--r--mm/huge_memory.c1
-rw-r--r--mm/mremap.c12
2 files changed, 5 insertions, 8 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index cba41397e218..958d1469de62 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1088,6 +1088,7 @@ int move_huge_pmd(struct vm_area_struct *vma, struct vm_area_struct *new_vma,
pmd = pmdp_get_and_clear(mm, old_addr, old_pmd);
VM_BUG_ON(!pmd_none(*new_pmd));
set_pmd_at(mm, new_addr, new_pmd, pmd);
+ flush_tlb_range(vma, old_addr, old_addr + PMD_SIZE);
spin_unlock(&mm->page_table_lock);
ret = 1;
}
diff --git a/mm/mremap.c b/mm/mremap.c
index 87bb8393e7d2..b64626f34ff4 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -77,6 +77,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
struct mm_struct *mm = vma->vm_mm;
pte_t *old_pte, *new_pte, pte;
spinlock_t *old_ptl, *new_ptl;
+ unsigned long len = old_end - old_addr;
if (vma->vm_file) {
/*
@@ -110,6 +111,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd,
}
arch_leave_lazy_mmu_mode();
+ flush_tlb_range(vma, old_end - len, old_end);
if (new_ptl != old_ptl)
spin_unlock(new_ptl);
pte_unmap(new_pte - 1);
@@ -126,7 +128,6 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
{
unsigned long extent, next, old_end;
pmd_t *old_pmd, *new_pmd;
- bool need_flush = false;
old_end = old_addr + len;
flush_cache_range(vma, old_addr, old_end);
@@ -152,12 +153,10 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
err = move_huge_pmd(vma, new_vma, old_addr,
new_addr, old_end,
old_pmd, new_pmd);
- if (err > 0) {
- need_flush = true;
+ if (err > 0)
continue;
- } else if (!err) {
+ else if (!err)
split_huge_page_pmd(vma->vm_mm, old_pmd);
- }
VM_BUG_ON(pmd_trans_huge(*old_pmd));
}
if (pmd_none(*new_pmd) && __pte_alloc(new_vma->vm_mm, new_vma,
@@ -170,10 +169,7 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
extent = LATENCY_LIMIT;
move_ptes(vma, old_pmd, old_addr, old_addr + extent,
new_vma, new_pmd, new_addr);
- need_flush = true;
}
- if (likely(need_flush))
- flush_tlb_range(vma, old_end-len, old_addr);
mmu_notifier_invalidate_range_end(vma->vm_mm, old_end-len, old_end);