summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2020-06-21 15:20:35 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2020-06-21 15:20:35 +1000
commit716a9cb6ebfa5614eebce5d0247f51ae38a5bf85 (patch)
treeb8b37aa97ca8a87f6bb1a413a9ce7d13d2bbdcc5 /mm
parentbfeb40727ccb116e26d1bfac530e93c5ebf24c01 (diff)
downloadlinux-next-716a9cb6ebfa5614eebce5d0247f51ae38a5bf85.tar.gz
mm-vmstat-add-events-for-pmd-based-thp-migration-without-split-fix
Fix 5.7-rc6-mm1 page migration crash in unmap_and_move(): when the page to be migrated has been freed from under us, that is considered a MIGRATEPAGE_SUCCESS, but no newpage has been allocated (and I don't think it would ever need to be counted as a successful THP migration). Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2005210643340.482@eggly.anvils Signed-off-by: Hugh Dickins <hughd@google.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'mm')
-rw-r--r--mm/migrate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 0d9a5c5e83cd..7a173c1fa81f 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1245,7 +1245,7 @@ out:
* we want to retry.
*/
if (rc == MIGRATEPAGE_SUCCESS) {
- if (PageTransHuge(newpage))
+ if (newpage && PageTransHuge(newpage))
thp_migration_success(true);
put_page(page);
if (reason == MR_MEMORY_FAILURE) {