]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/migrate.c
media: dvb_ca_en50221: prevent using slot_info for Spectre attacs
[mirror_ubuntu-bionic-kernel.git] / mm / migrate.c
index 1236449b4777be3cf61e8cd68616c2c3faa5fd9f..4d0be47a322a8a33491c94072100ebcec829becd 100644 (file)
@@ -2089,7 +2089,11 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
        set_page_owner_migrate_reason(new_page, MR_NUMA_MISPLACED);
 
        spin_unlock(ptl);
-       mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
+       /*
+        * No need to double call mmu_notifier->invalidate_range() callback as
+        * the above pmdp_huge_clear_flush_notify() did already call it.
+        */
+       mmu_notifier_invalidate_range_only_end(mm, mmun_start, mmun_end);
 
        /* Take an "isolate" reference and put new page on the LRU. */
        get_page(new_page);
@@ -2805,9 +2809,14 @@ static void migrate_vma_pages(struct migrate_vma *migrate)
                        migrate->src[i] &= ~MIGRATE_PFN_MIGRATE;
        }
 
+       /*
+        * No need to double call mmu_notifier->invalidate_range() callback as
+        * the above ptep_clear_flush_notify() inside migrate_vma_insert_page()
+        * did already call it.
+        */
        if (notified)
-               mmu_notifier_invalidate_range_end(mm, mmu_start,
-                                                 migrate->end);
+               mmu_notifier_invalidate_range_only_end(mm, mmu_start,
+                                                      migrate->end);
 }
 
 /*