Skip to contentSkip to conversation

mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 3, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/khugepaged: add tracepoint to hpage_collapse_scan_file()
has been removed from the -mm tree. Its filename was
mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Zach O'Keefe" <[email protected]>
Subject: mm/khugepaged: add tracepoint to hpage_collapse_scan_file()
Date: Thu, 22 Sep 2022 15:40:40 -0700

Add huge_memory:trace_mm_khugepaged_scan_file tracepoint to hpage_collapse_scan_file() analogously to hpage_collapse_scan_pmd().

While this change is targeted at debugging MADV_COLLAPSE pathway, the "mm_khugepaged" prefix is retained for symmetry with huge_memory:trace_mm_khugepaged_scan_pmd, which retains it's legacy name to prevent changing kernel ABI as much as possible.

Cc Axel Rasmussen <[email protected]>
Cc Chris Kennelly <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc David Rientjes <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc James Houghton <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Pasha Tatashin <[email protected]>
Cc Peter Xu <[email protected]>
Cc Rongwei Wang <[email protected]>
Cc SeongJae Park <[email protected]>
Cc Song Liu <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 include/trace/events/huge_memory.h |   34 +++++++++++++++++++++++++++
 mm/khugepaged.c                    |    3 +-
 2 files changed, 36 insertions(+), 1 deletion(-)
include/trace/events/huge_memory.h renamed from include/trace/events/huge_memory.h~mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file +34 -0
@@ -169,5 +169,39 @@ TRACE_EVENT(mm_collapse_huge_page_swapin
 		__entry->ret)
 );
 
+TRACE_EVENT(mm_khugepaged_scan_file,
+
+	TP_PROTO(struct mm_struct *mm, struct page *page, const char *filename,
+		 int present, int swap, int result),
+
+	TP_ARGS(mm, page, filename, present, swap, result),
+
+	TP_STRUCT__entry(
+		__field(struct mm_struct *, mm)
+		__field(unsigned long, pfn)
+		__string(filename, filename)
+		__field(int, present)
+		__field(int, swap)
+		__field(int, result)
+	),
+
+	TP_fast_assign(
+		__entry->mm = mm;
+		__entry->pfn = page ? page_to_pfn(page) : -1;
+		__assign_str(filename, filename);
+		__entry->present = present;
+		__entry->swap = swap;
+		__entry->result = result;
+	),
+
+	TP_printk("mm=%p, scan_pfn=0x%lx, filename=%s, present=%d, swap=%d, result=%s",
+		__entry->mm,
+		__entry->pfn,
+		__get_str(filename),
+		__entry->present,
+		__entry->swap,
+		__print_symbolic(__entry->result, SCAN_STATUS))
+);
+
 #endif /* __HUGE_MEMORY_H */
 #include <trace/define_trace.h>
mm/khugepaged.c renamed from mm/khugepaged.c~mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file +2 -1
@@ -2157,7 +2157,8 @@ static int hpage_collapse_scan_file(stru
 		}
 	}
 
-	/* TODO: tracepoints */
+	trace_mm_khugepaged_scan_file(mm, page, file->f_path.dentry->d_iname,
+				      present, swap, result);
 	return result;
 }
 #else

_

Patches currently in -mm which might be from [email protected] are