[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1B46DDFA-4AAB-4C49-8AF0-65DDDE0EE854@nvidia.com>
Date: Mon, 16 Oct 2023 11:44:43 -0400
From: Zi Yan <ziy@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Zi Yan <ziy@...dia.com>, linux-mm@...ck.org,
"\"Matthew Wilcox (Oracle)\"" <willy@...radead.org>,
David Hildenbrand <david@...hat.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Huang Ying <ying.huang@...el.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm/migrate: correct nr_failed in migrate_pages_sync()
On 16 Oct 2023, at 11:41, Zi Yan wrote:
> From: Zi Yan <ziy@...dia.com>
>
> nr_failed was missing the large folio splits from migrate_pages_batch()
> and can cause a mismatch between migrate_pages() return value and the
> number of not migrated pages, i.e., when the return value of
> migrate_pages() is 0, there are still pages left in the from page list.
> It will happen when a non-PMD THP large folio fails to migrate due to
> -ENOMEM and is split successfully but not all the split pages are not
> migrated, migrate_pages_batch() would return non-zero, but
> astats.nr_thp_split = 0. nr_failed would be 0 and returned to the caller
> of migrate_pages(), but the not migrated pages are left in the from page
> list without being added back to LRU lists.
>
> Fix it by adding a new nr_split counter for large folio splits and adding
> it to nr_failed in migrate_page_sync() after migrate_pages_batch() is
> done.
>
> Fixes: 2ef7dbb26990 ("migrate_pages: try migrate in batch asynchronously firstly")
> Signed-off-by: Zi Yan <ziy@...dia.com>
> ---
> include/trace/events/migrate.h | 24 ++++++++++++++----------
> mm/migrate.c | 15 +++++++++++----
> 2 files changed, 25 insertions(+), 14 deletions(-)
Hi Andrew,
If Ying is OK with this patch, it should place my previous fix:
https://lore.kernel.org/linux-mm/20231009203231.1715845-2-zi.yan@sent.com/
--
Best Regards,
Yan, Zi
Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)
Powered by blists - more mailing lists