mm: compaction: fix the migration stats in trace_mm_compaction_migratepages()
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Fri, 14 Jan 2022 22:08:40 +0000 (14:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Jan 2022 14:30:30 +0000 (16:30 +0200)
commit84b328aa81216e08804d8875d63f26bda1298788
treeb15032fb8cc42ace0ad76ea131b899e3151b48fe
parent5d39a7ebc8be70e30176aed6f98f799bfa7439d6
mm: compaction: fix the migration stats in trace_mm_compaction_migratepages()

Now the migrate_pages() has changed to return the number of {normal
page, THP, hugetlb} instead, thus we should not use the return value to
calculate the number of pages migrated successfully.  Instead we can
just use the 'nr_succeeded' which indicates the number of normal pages
migrated successfully to calculate the non-migrated pages in
trace_mm_compaction_migratepages().

Link: https://lkml.kernel.org/r/b4225251c4bec068dcd90d275ab7de88a39e2bd7.1636275127.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/trace/events/compaction.h
mm/compaction.c