The patch titled Subject: migrate_pages(): fix failure counting for THP subpages retrying has been added to the -mm mm-unstable branch. Its filename is migrate_pages-fix-failure-counting-for-thp-subpages-retrying.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/migrate_pages-fix-failure-counting-for-thp-subpages-retrying.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Huang Ying <ying.huang@xxxxxxxxx> Subject: migrate_pages(): fix failure counting for THP subpages retrying Date: Wed, 17 Aug 2022 16:14:04 +0800 If THP is failed to be migrated for -ENOSYS and -ENOMEM, the THP will be split into thp_split_pages, and after other pages are migrated, pages in thp_split_pages will be migrated with no_subpage_counting == true, because its failure have been counted already. If some pages in thp_split_pages are retried during migration, we should not count their failure if no_subpage_counting == true too. This is done this patch to fix the failure counting for THP subpages retrying. Link: https://lkml.kernel.org/r/20220817081408.513338-5-ying.huang@xxxxxxxxx Fixes: 5984fabb6e82 ("mm: move_pages: report the number of non-attempted pages") Signed-off-by: "Huang, Ying" <ying.huang@xxxxxxxxx> Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Reviewed-by: Oscar Salvador <osalvador@xxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Cc: Yang Shi <shy828301@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/migrate.c~migrate_pages-fix-failure-counting-for-thp-subpages-retrying +++ a/mm/migrate.c @@ -1545,7 +1545,8 @@ retry: } } } - nr_failed += retry; + if (!no_subpage_counting) + nr_failed += retry; nr_thp_failed += thp_retry; /* * Try to migrate subpages of fail-to-migrate THPs, no nr_failed _ Patches currently in -mm which might be from ying.huang@xxxxxxxxx are memory-tiering-hot-page-selection-with-hint-page-fault-latency.patch memory-tiering-rate-limit-numa-migration-throughput.patch memory-tiering-adjust-hot-threshold-automatically.patch migrate-fix-syscall-move_pages-return-value-for-failure.patch migrate_pages-remove-unnecessary-list_safe_reset_next.patch migrate_pages-fix-thp-failure-counting-for-enomem.patch migrate_pages-fix-failure-counting-for-thp-subpages-retrying.patch migrate_pages-fix-failure-counting-for-thp-on-enosys.patch migrate_pages-fix-failure-counting-for-thp-splitting.patch migrate_pages-fix-failure-counting-for-retry.patch