* [PATCH] migrate_pages_batch: fix statistics for longterm pin retry
@ 2023-04-16 23:59 Huang Ying
2023-04-19 7:34 ` Baolin Wang
0 siblings, 1 reply; 2+ messages in thread
From: Huang Ying @ 2023-04-16 23:59 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Huang Ying, Baolin Wang, Alistair Popple,
David Hildenbrand, Yang Shi, Zi Yan
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@intel.com>
Cc: 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>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] migrate_pages_batch: fix statistics for longterm pin retry
2023-04-16 23:59 [PATCH] migrate_pages_batch: fix statistics for longterm pin retry Huang Ying
@ 2023-04-19 7:34 ` Baolin Wang
0 siblings, 0 replies; 2+ messages in thread
From: Baolin Wang @ 2023-04-19 7:34 UTC (permalink / raw)
To: Huang Ying, Andrew Morton
Cc: linux-mm, linux-kernel, Alistair Popple, David Hildenbrand,
Yang Shi, Zi Yan
On 4/17/2023 7:59 AM, Huang Ying wrote:
> 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.
Makes sense to me. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.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>
> Cc: 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>
> ---
> 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;
> }
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-19 7:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-16 23:59 [PATCH] migrate_pages_batch: fix statistics for longterm pin retry Huang Ying
2023-04-19 7:34 ` Baolin Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox