All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, ying.huang@intel.com,
	willy@infradead.org, david@redhat.com,
	baolin.wang@linux.alibaba.com, ziy@nvidia.com,
	akpm@linux-foundation.org
Subject: [to-be-updated] mm-migrate-correct-nr_failed-in-migrate_pages_sync.patch removed from -mm tree
Date: Mon, 16 Oct 2023 15:24:47 -0700	[thread overview]
Message-ID: <20231016222447.AD13BC433C7@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: mm/migrate: correct nr_failed in migrate_pages_sync()
has been removed from the -mm tree.  Its filename was
     mm-migrate-correct-nr_failed-in-migrate_pages_sync.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Zi Yan <ziy@nvidia.com>
Subject: mm/migrate: correct nr_failed in migrate_pages_sync()
Date: Mon, 9 Oct 2023 16:32:31 -0400

In the upstream tree, large folios can be migrated via move_pages()
syscall and there is no VM_BUG_ON in do_move_pages_to_node() but pages
left in the source page list will not be returned to LRU lists.  This is
from my code inspection and I have not reproduced it on upstream tree yet.

nr_failed was missing the rc value 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.

Link: https://lkml.kernel.org/r/20231009203231.1715845-2-zi.yan@sent.com
Fixes: 2ef7dbb26990 ("migrate_pages: try migrate in batch asynchronously firstly")
Signed-off-by: Zi Yan <ziy@nvidia.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/migrate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/migrate.c~mm-migrate-correct-nr_failed-in-migrate_pages_sync
+++ a/mm/migrate.c
@@ -1834,7 +1834,7 @@ static int migrate_pages_sync(struct lis
 		return rc;
 	}
 	stats->nr_thp_failed += astats.nr_thp_split;
-	nr_failed += astats.nr_thp_split;
+	nr_failed += rc + astats.nr_thp_split;
 	/*
 	 * Fall back to migrate all failed folios one by one synchronously. All
 	 * failed folios except split THPs will be retried, so their failure
_

Patches currently in -mm which might be from ziy@nvidia.com are



                 reply	other threads:[~2023-10-16 22:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231016222447.AD13BC433C7@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.