Re: [RFC PATCH v0 2/2] mm: sched: Batch-migrate misplaced pages

From: Bharata B Rao
Date: Mon May 26 2025 - 01:15:10 EST


On 22-May-25 9:41 PM, David Hildenbrand wrote:
On 21.05.25 10:02, Bharata B Rao wrote:
Currently the folios identified as misplaced by the NUMA
balancing sub-system are migrated one by one from the NUMA
hint fault handler as and when they are identified as
misplaced.

Instead of such singe folio migrations, batch them and
migrate them at once.

Identified misplaced folios are isolated and stored in
a per-task list. A new task_work is queued from task tick
handler to migrate them in batches. Migration is done
periodically or if pending number of isolated foios exceeds
a threshold.

That means that these pages are effectively unmovable for other purposes (CMA, compaction, long-term pinning, whatever) until that list was drained.

Bad.

During the last week's MM alignment call on this subject, it was decided not to isolate and batch from fault context and migrate from task_work context like this.

However since the amount of time the folios stay in isolated state was
bounded both by time(1s in my patchset) and the number of folios isolated, I thought it should be okay, but I may be wrong.

Regards,
Bharata.