* mm/rmap: Should vma_migratable be checked in try_to_migrate_one?
@ 2026-03-11 13:46 Riwan
2026-03-12 16:31 ` Gregory Price
0 siblings, 1 reply; 2+ messages in thread
From: Riwan @ 2026-03-11 13:46 UTC (permalink / raw)
To: Andrew Morton (maintainer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
David Hildenbrand (maintainer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Lorenzo Stoakes (maintainer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Rik van Riel (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Liam R. Howlett (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Vlastimil Babka (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Harry Yoo (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Jann Horn (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Zi Yan (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Matthew Brost (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Joshua Hahn (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Rakie Kim (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Byungchul Park (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Gregory Price (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Ying Huang (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Alistair Popple (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
open list:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING), open list
[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]
Hi, I’m a phd student working on memory management and I have the following question:
Is it intentional to not check for `vma_migratable` in `try_to_migrate_one` ?
If the vma is not migratable, it would be logical to cancel the page migration at this point.
From what I understand, `vma_migratable` is called to check if a pages in a specific VMA can be migrated or not.
From what I can see, user-facing migration paths (mbind, move_pages) and NUMA balancing already check wether migration is possible or not with `vma_migratable`, but other migration path, such as compaction with kcompactd, ignore this check.
As `try_to_migrate_one` is the only place where we have access to the vma (due to reverse mapping), it would be logical to check here for `vma_migratable` (before we only have access to the folio).
I’m still new to the Linux Kernel, and may have missed critical subsystem / behavior, and I would be curious to know if this was overlooked or if there is a reason behind not calling `vma_migratable`.
From what I could get, here is the relevant context:
- Implem of vma_migratable : mm/mempolicy: check hugepage migration is supported by arch in vma_migratable() (https://lore.kernel.org/all/20200402041052.Y4zsoYman%25akpm@linux-foundation.org/)
- Implem of try_to_migrate_one, previously managed in try_to_unmap_one : mm/rmap: split migration into its own function (https://lore.kernel.org/all/20210701015416.0t4MkxtDR%25akpm@linux-foundation.org/)
Thanks a lot
Riwan Coëffic
[-- Attachment #2: Type: text/html, Size: 2004 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mm/rmap: Should vma_migratable be checked in try_to_migrate_one?
2026-03-11 13:46 mm/rmap: Should vma_migratable be checked in try_to_migrate_one? Riwan
@ 2026-03-12 16:31 ` Gregory Price
0 siblings, 0 replies; 2+ messages in thread
From: Gregory Price @ 2026-03-12 16:31 UTC (permalink / raw)
To: Riwan
Cc: Andrew Morton (maintainer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
David Hildenbrand (maintainer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Lorenzo Stoakes (maintainer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Rik van Riel (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Liam R. Howlett (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Vlastimil Babka (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Harry Yoo (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Jann Horn (reviewer:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)),
Zi Yan (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Matthew Brost (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Joshua Hahn (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Rakie Kim (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Byungchul Park (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Ying Huang (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
Alistair Popple (reviewer:MEMORY MANAGEMENT - MEMORY POLICY AND MIGRATION),
open list:MEMORY MANAGEMENT - RMAP (REVERSE MAPPING), open list
On Wed, Mar 11, 2026 at 02:46:55PM +0100, Riwan wrote:
> Hi, I’m a phd student working on memory management and I have the following question:
> Is it intentional to not check for `vma_migratable` in `try_to_migrate_one` ?
> If the vma is not migratable, it would be logical to cancel the page migration at this point.
>
> From what I understand, `vma_migratable` is called to check if a pages in a specific VMA can be migrated or not.
> From what I can see, user-facing migration paths (mbind, move_pages) and NUMA balancing already check wether migration is possible or not with `vma_migratable`, but other migration path, such as compaction with kcompactd, ignore this check.
> As `try_to_migrate_one` is the only place where we have access to the vma (due to reverse mapping), it would be logical to check here for `vma_migratable` (before we only have access to the folio).
>
> I’m still new to the Linux Kernel, and may have missed critical subsystem / behavior, and I would be curious to know if this was overlooked or if there is a reason behind not calling `vma_migratable`.
>
> From what I could get, here is the relevant context:
> - Implem of vma_migratable : mm/mempolicy: check hugepage migration is supported by arch in vma_migratable() (https://lore.kernel.org/all/20200402041052.Y4zsoYman%25akpm@linux-foundation.org/)
> - Implem of try_to_migrate_one, previously managed in try_to_unmap_one : mm/rmap: split migration into its own function (https://lore.kernel.org/all/20210701015416.0t4MkxtDR%25akpm@linux-foundation.org/)
>
Cursory look, it appears that vma_migratable is intended as a shortcut
to determine if an entire given VMA is otherwise not eligible for
migration (if it's backed by dax, then it's assumed the data should
just live there always and forever).
This is different than kcompact and others which touch individual
folios - but will have different ways to determine the same thing.
If you're just trying to migrate one folio, you can get everything you
need mostly from the folio's flags, and so most of the callers you're
concerned about most likely do eactly this.
~Gregory
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-12 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 13:46 mm/rmap: Should vma_migratable be checked in try_to_migrate_one? Riwan
2026-03-12 16:31 ` Gregory Price
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox