diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/huge_memory.c | 7 | ||||
-rw-r--r-- | mm/mprotect.c | 2 | ||||
-rw-r--r-- | mm/pgtable-generic.c | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index b2e803e14ea9..6bd22902d289 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1352,6 +1352,13 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | /* | 1354 | /* |
1355 | * The page_table_lock above provides a memory barrier | ||
1356 | * with change_protection_range. | ||
1357 | */ | ||
1358 | if (mm_tlb_flush_pending(mm)) | ||
1359 | flush_tlb_range(vma, haddr, haddr + HPAGE_PMD_SIZE); | ||
1360 | |||
1361 | /* | ||
1355 | * Migrate the THP to the requested node, returns with page unlocked | 1362 | * Migrate the THP to the requested node, returns with page unlocked |
1356 | * and pmd_numa cleared. | 1363 | * and pmd_numa cleared. |
1357 | */ | 1364 | */ |
diff --git a/mm/mprotect.c b/mm/mprotect.c index d4d5399c7aba..e9f65aaa3182 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -206,6 +206,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma, | |||
206 | BUG_ON(addr >= end); | 206 | BUG_ON(addr >= end); |
207 | pgd = pgd_offset(mm, addr); | 207 | pgd = pgd_offset(mm, addr); |
208 | flush_cache_range(vma, addr, end); | 208 | flush_cache_range(vma, addr, end); |
209 | set_tlb_flush_pending(mm); | ||
209 | do { | 210 | do { |
210 | next = pgd_addr_end(addr, end); | 211 | next = pgd_addr_end(addr, end); |
211 | if (pgd_none_or_clear_bad(pgd)) | 212 | if (pgd_none_or_clear_bad(pgd)) |
@@ -217,6 +218,7 @@ static unsigned long change_protection_range(struct vm_area_struct *vma, | |||
217 | /* Only flush the TLB if we actually modified any entries: */ | 218 | /* Only flush the TLB if we actually modified any entries: */ |
218 | if (pages) | 219 | if (pages) |
219 | flush_tlb_range(vma, start, end); | 220 | flush_tlb_range(vma, start, end); |
221 | clear_tlb_flush_pending(mm); | ||
220 | 222 | ||
221 | return pages; | 223 | return pages; |
222 | } | 224 | } |
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index eb900bbaa713..4b62a16fc3c1 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c | |||
@@ -86,9 +86,10 @@ int pmdp_clear_flush_young(struct vm_area_struct *vma, | |||
86 | pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, | 86 | pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address, |
87 | pte_t *ptep) | 87 | pte_t *ptep) |
88 | { | 88 | { |
89 | struct mm_struct *mm = (vma)->vm_mm; | ||
89 | pte_t pte; | 90 | pte_t pte; |
90 | pte = ptep_get_and_clear((vma)->vm_mm, address, ptep); | 91 | pte = ptep_get_and_clear(mm, address, ptep); |
91 | if (pte_accessible(pte)) | 92 | if (pte_accessible(mm, pte)) |
92 | flush_tlb_page(vma, address); | 93 | flush_tlb_page(vma, address); |
93 | return pte; | 94 | return pte; |
94 | } | 95 | } |