Skip to content

Commit 7dcd620

Browse files
yhuang-intelgregkh
authored andcommitted
migrate_pages_batch: fix statistics for longterm pin retry
commit 851ae6424697d1c4f085cb878c88168923ebcad1 upstream. In commit fd4a7ac32918 ("mm: migrate: try again if THP split is failed due to page refcnt"), if the THP splitting fails due to page reference count, we will retry to improve migration successful rate. But the failed splitting is counted as migration failure and migration retry, which will cause duplicated failure counting. So, in this patch, this is fixed via undoing the failure counting if we decide to retry. The patch is tested via failure injection. Link: https://lkml.kernel.org/r/[email protected] Fixes: fd4a7ac32918 ("mm: migrate: try again if THP split is failed due to page refcnt") Signed-off-by: "Huang, Ying" <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Cc: Alistair Popple <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Yang Shi <[email protected]> Cc: Zi Yan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b366022 commit 7dcd620

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mm/migrate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,9 @@ static int migrate_pages_batch(struct list_head *from, new_page_t get_new_page,
17001700
large_retry++;
17011701
thp_retry += is_thp;
17021702
nr_retry_pages += nr_pages;
1703+
/* Undo duplicated failure counting. */
1704+
nr_large_failed--;
1705+
stats->nr_thp_failed -= is_thp;
17031706
break;
17041707
}
17051708
}

0 commit comments

Comments
 (0)