summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2023-04-17 07:59:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-08 16:26:48 +0100
commit7dcd6204160ee147fa902d30657c4fc7e16d5a4e (patch)
tree5fea7695bc1458f9a5bc4ca0f01c13194854af5d
parentb3660228db5a7709e8f230482d7c9f93c19d02d1 (diff)
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/20230416235929.1040194-1-ying.huang@intel.com Fixes: fd4a7ac32918 ("mm: migrate: try again if THP split is failed due to page refcnt") Signed-off-by: "Huang, Ying" <ying.huang@intel.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: Alistair Popple <apopple@nvidia.com> Cc: David Hildenbrand <david@redhat.com> Cc: Yang Shi <shy828301@gmail.com> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--mm/migrate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 8393f4a935a9..209078154a46 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1700,6 +1700,9 @@ split_folio_migration:
large_retry++;
thp_retry += is_thp;
nr_retry_pages += nr_pages;
+ /* Undo duplicated failure counting. */
+ nr_large_failed--;
+ stats->nr_thp_failed -= is_thp;
break;
}
}