diff options
author | Zi Yan <[email protected]> | 2023-10-17 12:31:28 -0400 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-10-25 16:47:13 -0700 |
commit | a259945efe6ada94087ef666e9b38f8e34ea34ba (patch) | |
tree | b7a6464a43e46262c4c1e49bb1ac0c4c66cc15e8 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 245245c2fffd0050772a3f30ba50e2be92537a32 (diff) |
mm/migrate: correct nr_failed in migrate_pages_sync()
nr_failed was missing the large folio splits from migrate_pages_batch()
and can cause a mismatch between migrate_pages() return value and the
number of not migrated pages, i.e., when the return value of
migrate_pages() is 0, there are still pages left in the from page list.
It will happen when a non-PMD THP large folio fails to migrate due to
-ENOMEM and is split successfully but not all the split pages are not
migrated, migrate_pages_batch() would return non-zero, but
astats.nr_thp_split = 0. nr_failed would be 0 and returned to the caller
of migrate_pages(), but the not migrated pages are left in the from page
list without being added back to LRU lists.
Fix it by adding a new nr_split counter for large folio splits and adding
it to nr_failed in migrate_page_sync() after migrate_pages_batch() is
done.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 2ef7dbb26990 ("migrate_pages: try migrate in batch asynchronously firstly")
Signed-off-by: Zi Yan <[email protected]>
Acked-by: Huang Ying <[email protected]>
Reviewed-by: Baolin Wang <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions