mm/huge_memory: optimize migration when huge PMD needs split
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm/huge_memory: return true if split_huge_pmd_locked() split PMD to migration entryinclude/ mm/ mm/ | +27 | 9 replies | |
| 2/2 | mm/selftests: add split_shared_pmd()tools/ | +72 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] mm/huge_memory: optimize migration when huge PMD needs split
This is a follow up optimization for commit 939080834fef ("mm/huge_memory:
fix early failure try_to_migrate() when split huge pmd for shared THP").
When split_huge_pmd_locked() successfully split the PMD entry with @freeze = true, it means each PTE entry are properly set to migration entry. And we can return from try_to_migrate_one() directly.
Currently it is done in a sub-optimal way: it always restarts the walk and go through each PTE entry by page_vma_mapped_walk() which then skip all of them when the PMD is split to migration entry.
Let split_huge_pmd_locked() indicate whether it split PMD to migration entry, so that to optimize migration if huge PMD needs split.
Also add a selftest to check the bug fixed in commit 939080834fef ("mm/huge_memory: fix early failure try_to_migrate() when split huge pmd for shared THP") will not be introduced.
Wei Yang (2):
mm/huge_memory: return true if split_huge_pmd_locked() split PMD to
migration entry
mm/selftests: add split_shared_pmd()
include/linux/huge_mm.h | 9 ++- mm/huge_memory.c | 21 ++++-- mm/rmap.c | 11 ++- .../selftests/mm/split_huge_page_test.c | 73 ++++++++++++++++++- 4 files changed, 99 insertions(+), 15 deletions(-)
Signature · 1 line
2.34.1