在 2/8/2022 7:50 PM, zhongjiang-ali 写道:
Currently, promote_success just include the normal
page count when
it is migrated from pmem node to toptier node, but an huge page also
can trigger the same operation when thp numa fault work. hence it
miss the count in migrate_misplaced_transhuge_page.
Signed-off-by: zhongjiang-ali <zhongjiang-ali(a)linux.alibaba.com>
LGTM.
Reviewed-by: Baolin Wang <baolin.wang(a)linux.alibaba.com>
---
mm/migrate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index e9adaa7..9d6cac9 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2138,7 +2138,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct
*vma,
if (nr_succeeded) {
count_vm_numa_events(NUMA_PAGE_MIGRATE, nr_succeeded);
if (!node_is_toptier(page_to_nid(page)) && node_is_toptier(node))
- mod_node_page_state(NODE_DATA(node), PGPROMOTE_SUCCESS,
+ mod_node_page_state(pgdat, PGPROMOTE_SUCCESS,
nr_succeeded);
}
BUG_ON(!list_empty(&migratepages));
@@ -2264,6 +2264,9 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm,
count_vm_events(PGMIGRATE_SUCCESS, HPAGE_PMD_NR);
count_vm_numa_events(NUMA_PAGE_MIGRATE, HPAGE_PMD_NR);
+ if (!node_is_toptier(page_to_nid(page)) && node_is_toptier(node))
+ mod_node_page_state(pgdat, PGPROMOTE_SUCCESS,
+ HPAGE_PMD_NR);
mod_node_page_state(page_pgdat(page),
NR_ISOLATED_ANON + page_lru,