mm: migrate: introduce a local variable to get the number of pages
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Wed, 8 Sep 2021 22:18:01 +0000 (15:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Sep 2021 22:32:34 +0000 (15:32 -0700)
commit2b9b624f5aef6af608edf541fed973948e27004c
tree3fc74f497d41fbd6be1d776200d3432d07fc4a8b
parentc68ed7945701a38f2121ed74e23ff19c2052b4c2
mm: migrate: introduce a local variable to get the number of pages

Use thp_nr_pages() instead of compound_nr() to get the number of pages for
THP page, meanwhile introducing a local variable 'nr_pages' to avoid
getting the number of pages repeatedly.

Link: https://lkml.kernel.org/r/a8e331ac04392ee230c79186330fb05e86a2aa77.1629447552.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/migrate.c