Skip to content

Commit 6c855fc

Browse files
Hugh Dickinstorvalds
Hugh Dickins
authored andcommitted
mm/rmap: try_to_migrate() skip zone_device !device_private
I know nothing about zone_device pages and !device_private pages; but if try_to_migrate_one() will do nothing for them, then it's better that try_to_migrate() filter them first, than trawl through all their vmas. Signed-off-by: Hugh Dickins <[email protected]> Reviewed-by: Shakeel Butt <[email protected]> Reviewed-by: Alistair Popple <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Cc: Andrew Morton <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Ralph Campbell <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Yang Shi <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 023e1a8 commit 6c855fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/rmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,9 +1703,6 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma,
17031703
struct mmu_notifier_range range;
17041704
enum ttu_flags flags = (enum ttu_flags)(long)arg;
17051705

1706-
if (is_zone_device_page(page) && !is_device_private_page(page))
1707-
return true;
1708-
17091706
/*
17101707
* When racing against e.g. zap_pte_range() on another cpu,
17111708
* in between its ptep_get_and_clear_full() and page_remove_rmap(),
@@ -1944,6 +1941,9 @@ void try_to_migrate(struct page *page, enum ttu_flags flags)
19441941
TTU_SYNC)))
19451942
return;
19461943

1944+
if (is_zone_device_page(page) && !is_device_private_page(page))
1945+
return;
1946+
19471947
/*
19481948
* During exec, a temporary VMA is setup and later moved.
19491949
* The VMA is moved under the anon_vma lock but not the

0 commit comments

Comments
 (0)