mm/migrate: remove cpages-- in migrate_vma_finalize()
authorRalph Campbell <rcampbell@nvidia.com>
Tue, 13 Oct 2020 23:58:39 +0000 (16:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Oct 2020 01:38:35 +0000 (18:38 -0700)
The variable struct migrate_vma->cpages is only used in
migrate_vma_setup().  There is no need to decrement it in
migrate_vma_finalize() since it is never checked.

Signed-off-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20200827190735.12752-1-rcampbell@nvidia.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/migrate.c

index 4de11df..b073490 100644 (file)
@@ -3077,7 +3077,6 @@ void migrate_vma_finalize(struct migrate_vma *migrate)
 
                remove_migration_ptes(page, newpage, false);
                unlock_page(page);
-               migrate->cpages--;
 
                if (is_zone_device_page(page))
                        put_page(page);