Re: [PATCH v8 1/8] mm: migrate: Allow misplaced migration without VMA
From: Davidlohr Bueso
Date: Tue Sep 29 2026 - 18:06:42 EST
On Tue, 28 Jul 2026, Bharata B Rao wrote:
We want isolation of misplaced folios to work in contexts
where VMA isn't available, typically when performing migrations
from a kernel thread context. In order to prepare for that,
allow migrate_misplaced_folio_prepare() to be called with
a NULL VMA.
When migrate_misplaced_folio_prepare() is called with non-NULL
VMA, it will check if the folio is mapped shared and that requires
holding PTL lock. This path isn't taken when the function is
invoked with NULL VMA (migration outside of process context).
Therefore, when VMA == NULL, migrate_misplaced_folio_prepare()
does not require the caller to hold the PTL.
Signed-off-by: Bharata B Rao <bharata@xxxxxxx>
Reviewed-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>