fix: mm: compaction: fix the migration stats in trace_mm_compaction_migratepages...
authorMichael Jeanson <mjeanson@efficios.com>
Sun, 23 Jan 2022 18:26:17 +0000 (13:26 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 28 Jan 2022 16:33:21 +0000 (11:33 -0500)
See upstream commit :

  commit 84b328aa81216e08804d8875d63f26bda1298788
  Author: Baolin Wang <baolin.wang@linux.alibaba.com>
  Date:   Fri Jan 14 14:08:40 2022 -0800

    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
Change-Id: Ib8e8f2a16a273f16cd73fe63afbbfc25c0a2540c
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/compaction.h

index 52d37c0447bf7527a148de7cab7558cdb5097cac..d3b5523e0d4f3f0bcf58e6422206c18a117aec71 100644 (file)
@@ -97,7 +97,20 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
 
 #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */
 
-#if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
+LTTNG_TRACEPOINT_EVENT(mm_compaction_migratepages,
+
+       TP_PROTO(unsigned long nr_all,
+               unsigned int nr_succeeded),
+
+       TP_ARGS(nr_all, nr_succeeded),
+
+       TP_FIELDS(
+               ctf_integer(unsigned long, nr_migrated, nr_succeeded)
+               ctf_integer(unsigned long, nr_failed, nr_all - nr_succeeded)
+       )
+)
+#elif LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \
        LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \
        (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0))
 LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages,
This page took 0.026472 seconds and 4 git commands to generate.