[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230416235929.1040194-1-ying.huang@intel.com>
Date: Mon, 17 Apr 2023 07:59:29 +0800
From: Huang Ying <ying.huang@...el.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Huang Ying <ying.huang@...el.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Alistair Popple <apopple@...dia.com>,
David Hildenbrand <david@...hat.com>,
Yang Shi <shy828301@...il.com>, Zi Yan <ziy@...dia.com>
Subject: [PATCH] migrate_pages_batch: fix statistics for longterm pin retry
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.
Fixes: fd4a7ac32918 ("mm: migrate: try again if THP split is failed due to page refcnt")
Signed-off-by: "Huang, Ying" <ying.huang@...el.com>
Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: Alistair Popple <apopple@...dia.com>
Cc: David Hildenbrand <david@...hat.com>
Cc: Yang Shi <shy828301@...il.com>
Cc: Zi Yan <ziy@...dia.com>
---
mm/migrate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/migrate.c b/mm/migrate.c
index b34a0f383795..47a1e8445f45 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1743,6 +1743,9 @@ static int migrate_pages_batch(struct list_head *from, new_page_t get_new_page,
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;
}
}
--
2.39.2
Powered by blists - more mailing lists