Re: [RFC PATCH v6 2/5] mm: migrate: Add migrate_misplaced_folios_batch()
From: Donet Tom
Date: Wed Apr 22 2026 - 00:06:38 EST
Hi Gregory
On 4/22/26 9:07 AM, Gregory Price wrote:
On Wed, Apr 22, 2026 at 08:56:59AM +0530, Bharata B Rao wrote:
On 21-Apr-26 9:35 PM, Gregory Price wrote:Wondering if the interface name should somehow reflect this as well, to
On Tue, Apr 21, 2026 at 08:55:02PM +0530, Donet Tom wrote:^ This is the expectation from the caller. pghot caller ensures this.
+/**
+ * migrate_misplaced_folios_batch() - Batch variant of migrate_misplaced_folio
+ * Attempts to migrate a folio list to the specified destination.
+ * @folio_list: Isolated list of folios to be batch-migrated.
+ * @node: The NUMA node ID to where the folios should be migrated.
+ *
+ * Caller is expected to have isolated the folios by calling
+ * migrate_misplaced_folio_prepare(), which will result in an
+ * elevated reference count on the folio. All the isolated folios
+ * in the list must belong to the same memcg so that NUMA_PAGE_MIGRATE
+ * stat can be attributed correctly to the memcg.
I could add a debug check in this routine to verify if that is indeed so.
make it a bit clearer.
I agree—this would make the interface clearer.
-Donet
~Gregory