[PATCH v2 00/13] mm: batch of (urgentish?) fixes in oomk, cachestat, dev-migrate, percpu
From: Lorenzo Stoakes (ARM)
Date: Fri Nov 13 2026 - 17:16:57 EST
A bunch of fixes for oomk, cachestat, device migration and the per-CPU
allocator.
These patches were originally AI-generated, tamed into upstreamable state.
Some are more reworked than others. Those which needed a significant
rethink are submitted as mine and marked as Reported-by the relevant
original author, others are smaller edits which are annotated as such in
the usual fashion.
Please check for correctness, sanity, and whether the cc: stable is
warranted (I have not included it for 3 where it seemed unwarranted.)
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
---
v2:
* Propagated tags, thanks everybody!
* Clarified commit message in 1/13 as per Michal.
* Added a description of the fix and its performance cost to the commit
message of 3/13, as per Usama.
* Updated 8/13 to also refuse to migrate KSM pages to device coherent
memory, as per Sashiko.
* Added Gregory's benchmark numbers to the commit message of 13/13.
v1:
https://lore.kernel.org/r/20261111-mason-migrate-et-al-fixes-v1-0-3d2454362e8d@xxxxxxxxxx
---
Chris Mason (5):
mm: cachestat: count each page only once
mm: cachestat: restart the walk after each entry
mm/migrate_device: fix ksmd oops on a migrated KSM page
mm/migrate_device: refuse to migrate shadow stacks
percpu: queue the balance work on an unbound workqueue
Josef Bacik (4):
mm/migrate_device: allocate THP deferred split heads
mm/migrate_device: don't collect a range twice
mm/migrate_device: don't let go of the fault page
mm/migrate_device: look up fault folio after a split
Lorenzo Stoakes (ARM) (4):
mm/mmap: free gathered pages before MMF_OOM_SKIP
mm/migrate_device: fix use-after-free of the anon rmap
percpu: fix contig hints that are too low
percpu: search the whole reserved chunk
include/linux/migrate.h | 1 +
include/linux/mm_types.h | 2 +
include/linux/oom.h | 9 ++++
mm/filemap.c | 21 +++++++---
mm/migrate_device.c | 107 ++++++++++++++++++++++++++++++++---------------
mm/mmap.c | 9 +++-
mm/oom_kill.c | 4 +-
mm/percpu.c | 69 +++++++++---------------------
8 files changed, 132 insertions(+), 90 deletions(-)
---
base-commit: 7f04048247a69019ccaa9c152002d3601b19453c
change-id: 20261107-mason-migrate-et-al-fixes-0494d34884c4
Cheers,
--
Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>