net: hns3: add query basic info support for VF
[linux-2.6-microblaze.git] / mm / migrate.c
index 6876696..b234c3f 100644 (file)
@@ -1418,6 +1418,8 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
        int rc, nr_subpages;
        LIST_HEAD(ret_pages);
 
+       trace_mm_migrate_pages_start(mode, reason);
+
        if (!swapwrite)
                current->flags |= PF_SWAPWRITE;
 
@@ -2084,17 +2086,6 @@ bool pmd_trans_migrating(pmd_t pmd)
        return PageLocked(page);
 }
 
-static inline bool is_shared_exec_page(struct vm_area_struct *vma,
-                                      struct page *page)
-{
-       if (page_mapcount(page) != 1 &&
-           (page_is_file_lru(page) || vma_is_shmem(vma)) &&
-           (vma->vm_flags & VM_EXEC))
-               return true;
-
-       return false;
-}
-
 /*
  * Attempt to migrate a misplaced page to the specified destination
  * node. Caller is expected to have an elevated reference count on
@@ -2112,7 +2103,8 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
         * Don't migrate file pages that are mapped in multiple processes
         * with execute permissions as they are probably shared libraries.
         */
-       if (is_shared_exec_page(vma, page))
+       if (page_mapcount(page) != 1 && page_is_file_lru(page) &&
+           (vma->vm_flags & VM_EXEC))
                goto out;
 
        /*
@@ -2167,9 +2159,6 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
        int page_lru = page_is_file_lru(page);
        unsigned long start = address & HPAGE_PMD_MASK;
 
-       if (is_shared_exec_page(vma, page))
-               goto out;
-
        new_page = alloc_pages_node(node,
                (GFP_TRANSHUGE_LIGHT | __GFP_THISNODE),
                HPAGE_PMD_ORDER);
@@ -2281,7 +2270,6 @@ out_fail:
 
 out_unlock:
        unlock_page(page);
-out:
        put_page(page);
        return 0;
 }
@@ -2791,11 +2779,11 @@ restore:
  *
  * For empty entries inside CPU page table (pte_none() or pmd_none() is true) we
  * do set MIGRATE_PFN_MIGRATE flag inside the corresponding source array thus
- * allowing the caller to allocate device memory for those unback virtual
- * address.  For this the caller simply has to allocate device memory and
+ * allowing the caller to allocate device memory for those unbacked virtual
+ * addresses.  For this the caller simply has to allocate device memory and
  * properly set the destination entry like for regular migration.  Note that
- * this can still fails and thus inside the device driver must check if the
- * migration was successful for those entries after calling migrate_vma_pages()
+ * this can still fail, and thus inside the device driver you must check if the
+ * migration was successful for those entries after calling migrate_vma_pages(),
  * just like for regular migration.
  *
  * After that, the callers must call migrate_vma_pages() to go over each entry