blob: 522753be28aebb74a5bf5d01d3de3047f3452e3f [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001From afc4fe8905620a3eb14a5ed16146dac1db0f8111 Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Sun, 23 Jan 2022 13:26:17 -0500
4Subject: [PATCH 3/7] fix: mm: compaction: fix the migration stats in
5 trace_mm_compaction_migratepages() (v5.17)
6
7See upstream commit :
8
9 commit 84b328aa81216e08804d8875d63f26bda1298788
10 Author: Baolin Wang <baolin.wang@linux.alibaba.com>
11 Date: Fri Jan 14 14:08:40 2022 -0800
12
13 mm: compaction: fix the migration stats in trace_mm_compaction_migratepages()
14
15 Now the migrate_pages() has changed to return the number of {normal
16 page, THP, hugetlb} instead, thus we should not use the return value to
17 calculate the number of pages migrated successfully. Instead we can
18 just use the 'nr_succeeded' which indicates the number of normal pages
19 migrated successfully to calculate the non-migrated pages in
20 trace_mm_compaction_migratepages().
21
22 Link: https://lkml.kernel.org/r/b4225251c4bec068dcd90d275ab7de88a39e2bd7.1636275127.git.baolin.wang@linux.alibaba.com
23
24Upstream-Status: Backport [lttng-modules commit afc4fe8905620a3eb14a5ed16146dac1db0f8111]
25
26Change-Id: Ib8e8f2a16a273f16cd73fe63afbbfc25c0a2540c
27Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
28Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
29---
30 include/instrumentation/events/compaction.h | 15 ++++++++++++++-
31 1 file changed, 14 insertions(+), 1 deletion(-)
32
33diff --git a/include/instrumentation/events/compaction.h b/include/instrumentation/events/compaction.h
34index 3cc25537..340e41f5 100644
35--- a/include/instrumentation/events/compaction.h
36+++ b/include/instrumentation/events/compaction.h
37@@ -97,7 +97,20 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template,
38
39 #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */
40
41-#if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \
42+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
43+LTTNG_TRACEPOINT_EVENT(mm_compaction_migratepages,
44+
45+ TP_PROTO(unsigned long nr_all,
46+ unsigned int nr_succeeded),
47+
48+ TP_ARGS(nr_all, nr_succeeded),
49+
50+ TP_FIELDS(
51+ ctf_integer(unsigned long, nr_migrated, nr_succeeded)
52+ ctf_integer(unsigned long, nr_failed, nr_all - nr_succeeded)
53+ )
54+)
55+#elif LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \
56 LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \
57 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0))
58 LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages,
59--
602.19.1
61