aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-15 18:52:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-15 18:52:01 -0500
commit988adfdffdd43cfd841df734664727993076d7cb (patch)
tree6794f7bba8f595500c2b7d33376ad6614adcfaf2 /mm
parent26178ec11ef3c6c814bf16a0a2b9c2f7242e3c64 (diff)
parent4e0cd68115620bc3236ff4e58e4c073948629b41 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie: "Highlights: - AMD KFD driver merge This is the AMD HSA interface for exposing a lowlevel interface for GPGPU use. They have an open source userspace built on top of this interface, and the code looks as good as it was going to get out of tree. - Initial atomic modesetting work The need for an atomic modesetting interface to allow userspace to try and send a complete set of modesetting state to the driver has arisen, and been suffering from neglect this past year. No more, the start of the common code and changes for msm driver to use it are in this tree. Ongoing work to get the userspace ioctl finished and the code clean will probably wait until next kernel. - DisplayID 1.3 and tiled monitor exposed to userspace. Tiled monitor property is now exposed for userspace to make use of. - Rockchip drm driver merged. - imx gpu driver moved out of staging Other stuff: - core: panel - MIPI DSI + new panels. expose suggested x/y properties for virtual GPUs - i915: Initial Skylake (SKL) support gen3/4 reset work start of dri1/ums removal infoframe tracking fixes for lots of things. - nouveau: tegra k1 voltage support GM204 modesetting support GT21x memory reclocking work - radeon: CI dpm fixes GPUVM improvements Initial DPM fan control - rcar-du: HDMI support added removed some support for old boards slave encoder driver for Analog Devices adv7511 - exynos: Exynos4415 SoC support - msm: a4xx gpu support atomic helper conversion - tegra: iommu support universal plane support ganged-mode DSI support - sti: HDMI i2c improvements - vmwgfx: some late fixes. - qxl: use suggested x/y properties" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (969 commits) drm: sti: fix module compilation issue drm/i915: save/restore GMBUS freq across suspend/resume on gen4 drm: sti: correctly cleanup CRTC and planes drm: sti: add HQVDP plane drm: sti: add cursor plane drm: sti: enable auxiliary CRTC drm: sti: fix delay in VTG programming drm: sti: prepare sti_tvout to support auxiliary crtc drm: sti: use drm_crtc_vblank_{on/off} instead of drm_vblank_{on/off} drm: sti: fix hdmi avi infoframe drm: sti: remove event lock while disabling vblank drm: sti: simplify gdp code drm: sti: clear all mixer control drm: sti: remove gpio for HDMI hot plug detection drm: sti: allow to change hdmi ddc i2c adapter drm/doc: Document drm_add_modes_noedid() usage drm/i915: Remove '& 0xffff' from the mask given to WA_REG() drm/i915: Invert the mask and val arguments in wa_add() and WA_REG() drm: Zero out DRM object memory upon cleanup drm/i915/bdw: Fix the write setting up the WIZ hashing mode ...
Diffstat (limited to 'mm')
-rw-r--r--mm/fremap.c2
-rw-r--r--mm/huge_memory.c9
-rw-r--r--mm/hugetlb.c7
-rw-r--r--mm/ksm.c4
-rw-r--r--mm/memory.c3
-rw-r--r--mm/migrate.c3
-rw-r--r--mm/mmu_notifier.c25
-rw-r--r--mm/rmap.c2
8 files changed, 44 insertions, 11 deletions
diff --git a/mm/fremap.c b/mm/fremap.c
index 11ef7ec40d13..2805d71cf476 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -37,7 +37,7 @@ static void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
37 37
38 if (pte_present(pte)) { 38 if (pte_present(pte)) {
39 flush_cache_page(vma, addr, pte_pfn(pte)); 39 flush_cache_page(vma, addr, pte_pfn(pte));
40 pte = ptep_clear_flush(vma, addr, ptep); 40 pte = ptep_clear_flush_notify(vma, addr, ptep);
41 page = vm_normal_page(vma, addr, pte); 41 page = vm_normal_page(vma, addr, pte);
42 if (page) { 42 if (page) {
43 if (pte_dirty(pte)) 43 if (pte_dirty(pte))
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 46f96c23cc27..817a875f2b8c 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1035,7 +1035,7 @@ static int do_huge_pmd_wp_page_fallback(struct mm_struct *mm,
1035 goto out_free_pages; 1035 goto out_free_pages;
1036 VM_BUG_ON_PAGE(!PageHead(page), page); 1036 VM_BUG_ON_PAGE(!PageHead(page), page);
1037 1037
1038 pmdp_clear_flush(vma, haddr, pmd); 1038 pmdp_clear_flush_notify(vma, haddr, pmd);
1039 /* leave pmd empty until pte is filled */ 1039 /* leave pmd empty until pte is filled */
1040 1040
1041 pgtable = pgtable_trans_huge_withdraw(mm, pmd); 1041 pgtable = pgtable_trans_huge_withdraw(mm, pmd);
@@ -1178,7 +1178,7 @@ alloc:
1178 pmd_t entry; 1178 pmd_t entry;
1179 entry = mk_huge_pmd(new_page, vma->vm_page_prot); 1179 entry = mk_huge_pmd(new_page, vma->vm_page_prot);
1180 entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma); 1180 entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma);
1181 pmdp_clear_flush(vma, haddr, pmd); 1181 pmdp_clear_flush_notify(vma, haddr, pmd);
1182 page_add_new_anon_rmap(new_page, vma, haddr); 1182 page_add_new_anon_rmap(new_page, vma, haddr);
1183 mem_cgroup_commit_charge(new_page, memcg, false); 1183 mem_cgroup_commit_charge(new_page, memcg, false);
1184 lru_cache_add_active_or_unevictable(new_page, vma); 1184 lru_cache_add_active_or_unevictable(new_page, vma);
@@ -1512,7 +1512,7 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
1512 pmd_t entry; 1512 pmd_t entry;
1513 ret = 1; 1513 ret = 1;
1514 if (!prot_numa) { 1514 if (!prot_numa) {
1515 entry = pmdp_get_and_clear(mm, addr, pmd); 1515 entry = pmdp_get_and_clear_notify(mm, addr, pmd);
1516 if (pmd_numa(entry)) 1516 if (pmd_numa(entry))
1517 entry = pmd_mknonnuma(entry); 1517 entry = pmd_mknonnuma(entry);
1518 entry = pmd_modify(entry, newprot); 1518 entry = pmd_modify(entry, newprot);
@@ -1644,6 +1644,7 @@ static int __split_huge_page_splitting(struct page *page,
1644 * serialize against split_huge_page*. 1644 * serialize against split_huge_page*.
1645 */ 1645 */
1646 pmdp_splitting_flush(vma, address, pmd); 1646 pmdp_splitting_flush(vma, address, pmd);
1647
1647 ret = 1; 1648 ret = 1;
1648 spin_unlock(ptl); 1649 spin_unlock(ptl);
1649 } 1650 }
@@ -2834,7 +2835,7 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
2834 pmd_t _pmd; 2835 pmd_t _pmd;
2835 int i; 2836 int i;
2836 2837
2837 pmdp_clear_flush(vma, haddr, pmd); 2838 pmdp_clear_flush_notify(vma, haddr, pmd);
2838 /* leave pmd empty until pte is filled */ 2839 /* leave pmd empty until pte is filled */
2839 2840
2840 pgtable = pgtable_trans_huge_withdraw(mm, pmd); 2841 pgtable = pgtable_trans_huge_withdraw(mm, pmd);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 47f6070d7c46..85032de5e20f 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2598,8 +2598,11 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
2598 } 2598 }
2599 set_huge_pte_at(dst, addr, dst_pte, entry); 2599 set_huge_pte_at(dst, addr, dst_pte, entry);
2600 } else { 2600 } else {
2601 if (cow) 2601 if (cow) {
2602 huge_ptep_set_wrprotect(src, addr, src_pte); 2602 huge_ptep_set_wrprotect(src, addr, src_pte);
2603 mmu_notifier_invalidate_range(src, mmun_start,
2604 mmun_end);
2605 }
2603 entry = huge_ptep_get(src_pte); 2606 entry = huge_ptep_get(src_pte);
2604 ptepage = pte_page(entry); 2607 ptepage = pte_page(entry);
2605 get_page(ptepage); 2608 get_page(ptepage);
@@ -2901,6 +2904,7 @@ retry_avoidcopy:
2901 2904
2902 /* Break COW */ 2905 /* Break COW */
2903 huge_ptep_clear_flush(vma, address, ptep); 2906 huge_ptep_clear_flush(vma, address, ptep);
2907 mmu_notifier_invalidate_range(mm, mmun_start, mmun_end);
2904 set_huge_pte_at(mm, address, ptep, 2908 set_huge_pte_at(mm, address, ptep,
2905 make_huge_pte(vma, new_page, 1)); 2909 make_huge_pte(vma, new_page, 1));
2906 page_remove_rmap(old_page); 2910 page_remove_rmap(old_page);
@@ -3376,6 +3380,7 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
3376 * and that page table be reused and filled with junk. 3380 * and that page table be reused and filled with junk.
3377 */ 3381 */
3378 flush_tlb_range(vma, start, end); 3382 flush_tlb_range(vma, start, end);
3383 mmu_notifier_invalidate_range(mm, start, end);
3379 i_mmap_unlock_write(vma->vm_file->f_mapping); 3384 i_mmap_unlock_write(vma->vm_file->f_mapping);
3380 mmu_notifier_invalidate_range_end(mm, start, end); 3385 mmu_notifier_invalidate_range_end(mm, start, end);
3381 3386
diff --git a/mm/ksm.c b/mm/ksm.c
index 6b2e337bc03c..d247efab5073 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -892,7 +892,7 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page,
892 * this assure us that no O_DIRECT can happen after the check 892 * this assure us that no O_DIRECT can happen after the check
893 * or in the middle of the check. 893 * or in the middle of the check.
894 */ 894 */
895 entry = ptep_clear_flush(vma, addr, ptep); 895 entry = ptep_clear_flush_notify(vma, addr, ptep);
896 /* 896 /*
897 * Check that no O_DIRECT or similar I/O is in progress on the 897 * Check that no O_DIRECT or similar I/O is in progress on the
898 * page 898 * page
@@ -960,7 +960,7 @@ static int replace_page(struct vm_area_struct *vma, struct page *page,
960 page_add_anon_rmap(kpage, vma, addr); 960 page_add_anon_rmap(kpage, vma, addr);
961 961
962 flush_cache_page(vma, addr, pte_pfn(*ptep)); 962 flush_cache_page(vma, addr, pte_pfn(*ptep));
963 ptep_clear_flush(vma, addr, ptep); 963 ptep_clear_flush_notify(vma, addr, ptep);
964 set_pte_at_notify(mm, addr, ptep, mk_pte(kpage, vma->vm_page_prot)); 964 set_pte_at_notify(mm, addr, ptep, mk_pte(kpage, vma->vm_page_prot));
965 965
966 page_remove_rmap(page); 966 page_remove_rmap(page);
diff --git a/mm/memory.c b/mm/memory.c
index fbf74112de5b..c3b9097251c5 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -239,6 +239,7 @@ static void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb)
239 return; 239 return;
240 240
241 tlb_flush(tlb); 241 tlb_flush(tlb);
242 mmu_notifier_invalidate_range(tlb->mm, tlb->start, tlb->end);
242#ifdef CONFIG_HAVE_RCU_TABLE_FREE 243#ifdef CONFIG_HAVE_RCU_TABLE_FREE
243 tlb_table_flush(tlb); 244 tlb_table_flush(tlb);
244#endif 245#endif
@@ -2220,7 +2221,7 @@ gotten:
2220 * seen in the presence of one thread doing SMC and another 2221 * seen in the presence of one thread doing SMC and another
2221 * thread doing COW. 2222 * thread doing COW.
2222 */ 2223 */
2223 ptep_clear_flush(vma, address, page_table); 2224 ptep_clear_flush_notify(vma, address, page_table);
2224 page_add_new_anon_rmap(new_page, vma, address); 2225 page_add_new_anon_rmap(new_page, vma, address);
2225 mem_cgroup_commit_charge(new_page, memcg, false); 2226 mem_cgroup_commit_charge(new_page, memcg, false);
2226 lru_cache_add_active_or_unevictable(new_page, vma); 2227 lru_cache_add_active_or_unevictable(new_page, vma);
diff --git a/mm/migrate.c b/mm/migrate.c
index 253474c22239..b1d02127e1be 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1862,7 +1862,7 @@ fail_putback:
1862 */ 1862 */
1863 flush_cache_range(vma, mmun_start, mmun_end); 1863 flush_cache_range(vma, mmun_start, mmun_end);
1864 page_add_anon_rmap(new_page, vma, mmun_start); 1864 page_add_anon_rmap(new_page, vma, mmun_start);
1865 pmdp_clear_flush(vma, mmun_start, pmd); 1865 pmdp_clear_flush_notify(vma, mmun_start, pmd);
1866 set_pmd_at(mm, mmun_start, pmd, entry); 1866 set_pmd_at(mm, mmun_start, pmd, entry);
1867 flush_tlb_range(vma, mmun_start, mmun_end); 1867 flush_tlb_range(vma, mmun_start, mmun_end);
1868 update_mmu_cache_pmd(vma, address, &entry); 1868 update_mmu_cache_pmd(vma, address, &entry);
@@ -1870,6 +1870,7 @@ fail_putback:
1870 if (page_count(page) != 2) { 1870 if (page_count(page) != 2) {
1871 set_pmd_at(mm, mmun_start, pmd, orig_entry); 1871 set_pmd_at(mm, mmun_start, pmd, orig_entry);
1872 flush_tlb_range(vma, mmun_start, mmun_end); 1872 flush_tlb_range(vma, mmun_start, mmun_end);
1873 mmu_notifier_invalidate_range(mm, mmun_start, mmun_end);
1873 update_mmu_cache_pmd(vma, address, &entry); 1874 update_mmu_cache_pmd(vma, address, &entry);
1874 page_remove_rmap(new_page); 1875 page_remove_rmap(new_page);
1875 goto fail_putback; 1876 goto fail_putback;
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 2c8da9825fe3..3b9b3d0741b2 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -193,6 +193,16 @@ void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
193 193
194 id = srcu_read_lock(&srcu); 194 id = srcu_read_lock(&srcu);
195 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) { 195 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
196 /*
197 * Call invalidate_range here too to avoid the need for the
198 * subsystem of having to register an invalidate_range_end
199 * call-back when there is invalidate_range already. Usually a
200 * subsystem registers either invalidate_range_start()/end() or
201 * invalidate_range(), so this will be no additional overhead
202 * (besides the pointer check).
203 */
204 if (mn->ops->invalidate_range)
205 mn->ops->invalidate_range(mn, mm, start, end);
196 if (mn->ops->invalidate_range_end) 206 if (mn->ops->invalidate_range_end)
197 mn->ops->invalidate_range_end(mn, mm, start, end); 207 mn->ops->invalidate_range_end(mn, mm, start, end);
198 } 208 }
@@ -200,6 +210,21 @@ void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
200} 210}
201EXPORT_SYMBOL_GPL(__mmu_notifier_invalidate_range_end); 211EXPORT_SYMBOL_GPL(__mmu_notifier_invalidate_range_end);
202 212
213void __mmu_notifier_invalidate_range(struct mm_struct *mm,
214 unsigned long start, unsigned long end)
215{
216 struct mmu_notifier *mn;
217 int id;
218
219 id = srcu_read_lock(&srcu);
220 hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list, hlist) {
221 if (mn->ops->invalidate_range)
222 mn->ops->invalidate_range(mn, mm, start, end);
223 }
224 srcu_read_unlock(&srcu, id);
225}
226EXPORT_SYMBOL_GPL(__mmu_notifier_invalidate_range);
227
203static int do_mmu_notifier_register(struct mmu_notifier *mn, 228static int do_mmu_notifier_register(struct mmu_notifier *mn,
204 struct mm_struct *mm, 229 struct mm_struct *mm,
205 int take_mmap_sem) 230 int take_mmap_sem)
diff --git a/mm/rmap.c b/mm/rmap.c
index c52f43a69eea..45ba250babd8 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1380,7 +1380,7 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount,
1380 1380
1381 /* Nuke the page table entry. */ 1381 /* Nuke the page table entry. */
1382 flush_cache_page(vma, address, pte_pfn(*pte)); 1382 flush_cache_page(vma, address, pte_pfn(*pte));
1383 pteval = ptep_clear_flush(vma, address, pte); 1383 pteval = ptep_clear_flush_notify(vma, address, pte);
1384 1384
1385 /* If nonlinear, store the file page offset in the pte. */ 1385 /* If nonlinear, store the file page offset in the pte. */
1386 if (page->index != linear_page_index(vma, address)) { 1386 if (page->index != linear_page_index(vma, address)) {