diff options
author | Zi Yan <[email protected]> | 2024-07-24 09:01:15 -0400 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-09-01 20:25:47 -0700 |
commit | ac59a1f0146f46bad7d5f8d1b20756ece43122ec (patch) | |
tree | 7edd572f78cdc8c623296941263f39df4a37948f | |
parent | 2a28713a67fd28eedc13b32300df6b9c5a2381f5 (diff) |
memory tiering: count PGPROMOTE_SUCCESS when mem tiering is enabled.
memory tiering can be enabled/disabled at runtime and
sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING is used to
check it. In migrate_misplaced_folio(), the check is missing when
PGPROMOTE_SUCCESS is incremented. Add the missing check.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 33024536bafd ("memory tiering: hot page selection with hint page fault latency")
Reported-by: Kefeng Wang <[email protected]>
Closes: https://lore.kernel.org/linux-mm/[email protected]/
Signed-off-by: Zi Yan <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Reviewed-by: Kefeng Wang <[email protected]>
Cc: Baolin Wang <[email protected]>
Cc: "Huang, Ying" <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | mm/migrate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 923ea80ba744..8578a930cad1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2636,7 +2636,9 @@ int migrate_misplaced_folio(struct folio *folio, struct vm_area_struct *vma, putback_movable_pages(&migratepages); if (nr_succeeded) { count_vm_numa_events(NUMA_PAGE_MIGRATE, nr_succeeded); - if (!node_is_toptier(folio_nid(folio)) && node_is_toptier(node)) + if ((sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) + && !node_is_toptier(folio_nid(folio)) + && node_is_toptier(node)) mod_node_page_state(pgdat, PGPROMOTE_SUCCESS, nr_succeeded); } |