Commit c23a0c99 authored by Ralph Campbell's avatar Ralph Campbell Committed by Linus Torvalds

mm/migrate: clean up some minor coding style

Fix some comment typos and coding style clean up in preparation for the
next patch.  No functional changes.

Link: http://lkml.kernel.org/r/20200107211208.24595-3-rcampbell@nvidia.comSigned-off-by: default avatarRalph Campbell <rcampbell@nvidia.com>
Acked-by: default avatarChris Down <chris@chrisdown.name>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: Bharata B Rao <bharata@linux.ibm.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 872ea707
...@@ -986,7 +986,7 @@ static int move_to_new_page(struct page *newpage, struct page *page, ...@@ -986,7 +986,7 @@ static int move_to_new_page(struct page *newpage, struct page *page,
} }
/* /*
* Anonymous and movable page->mapping will be cleard by * Anonymous and movable page->mapping will be cleared by
* free_pages_prepare so don't reset it here for keeping * free_pages_prepare so don't reset it here for keeping
* the type to work PageAnon, for example. * the type to work PageAnon, for example.
*/ */
...@@ -1199,8 +1199,7 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page, ...@@ -1199,8 +1199,7 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page,
/* /*
* A page that has been migrated has all references * A page that has been migrated has all references
* removed and will be freed. A page that has not been * removed and will be freed. A page that has not been
* migrated will have kepts its references and be * migrated will have kept its references and be restored.
* restored.
*/ */
list_del(&page->lru); list_del(&page->lru);
...@@ -2779,27 +2778,18 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate, ...@@ -2779,27 +2778,18 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate,
if (pte_present(*ptep)) { if (pte_present(*ptep)) {
unsigned long pfn = pte_pfn(*ptep); unsigned long pfn = pte_pfn(*ptep);
if (!is_zero_pfn(pfn)) { if (!is_zero_pfn(pfn))
pte_unmap_unlock(ptep, ptl); goto unlock_abort;
mem_cgroup_cancel_charge(page, memcg, false);
goto abort;
}
flush = true; flush = true;
} else if (!pte_none(*ptep)) { } else if (!pte_none(*ptep))
pte_unmap_unlock(ptep, ptl); goto unlock_abort;
mem_cgroup_cancel_charge(page, memcg, false);
goto abort;
}
/* /*
* Check for usefaultfd but do not deliver the fault. Instead, * Check for userfaultfd but do not deliver the fault. Instead,
* just back off. * just back off.
*/ */
if (userfaultfd_missing(vma)) { if (userfaultfd_missing(vma))
pte_unmap_unlock(ptep, ptl); goto unlock_abort;
mem_cgroup_cancel_charge(page, memcg, false);
goto abort;
}
inc_mm_counter(mm, MM_ANONPAGES); inc_mm_counter(mm, MM_ANONPAGES);
page_add_new_anon_rmap(page, vma, addr, false); page_add_new_anon_rmap(page, vma, addr, false);
...@@ -2823,6 +2813,9 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate, ...@@ -2823,6 +2813,9 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate,
*src = MIGRATE_PFN_MIGRATE; *src = MIGRATE_PFN_MIGRATE;
return; return;
unlock_abort:
pte_unmap_unlock(ptep, ptl);
mem_cgroup_cancel_charge(page, memcg, false);
abort: abort:
*src &= ~MIGRATE_PFN_MIGRATE; *src &= ~MIGRATE_PFN_MIGRATE;
} }
...@@ -2855,9 +2848,8 @@ void migrate_vma_pages(struct migrate_vma *migrate) ...@@ -2855,9 +2848,8 @@ void migrate_vma_pages(struct migrate_vma *migrate)
} }
if (!page) { if (!page) {
if (!(migrate->src[i] & MIGRATE_PFN_MIGRATE)) { if (!(migrate->src[i] & MIGRATE_PFN_MIGRATE))
continue; continue;
}
if (!notified) { if (!notified) {
notified = true; notified = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment