History

mm/migration: add trace events for THP migrations

Patch series "mm/migration: Add trace events", v3. This adds trace events for all migration scenarios including base page, THP and HugeTLB. This patch (of 3): This adds two trace events for PMD based THP migration without split. These events closely follow the implementation details like setting and removing of PMD migration entries, which are essential operations for THP migration. This moves CREATE_TRACE_POINTS into generic THP from powerpc for these new trace events to be available on other platforms as well.

Anshuman Khandual committed 4 years ago

Commit 283fd6f1 parent 5d543f13 files · +32 −1Browse files

Unified · Split

3 files
  1. arch/powerpc/mm/book3s64/trace.c +0 −1
  2. include/trace/events/thp.h +27 −0
  3. mm/huge_memory.c +5 −0
arch/powerpc/mm/book3s64/trace.c+0−1
@@ -3,6 +3,5 @@ · 2 unmodified lines
33 * This file is for defining trace points and trace related helpers.
44 */
55 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
6−#define CREATE_TRACE_POINTS
76 #include <trace/events/thp.h>
87 #endif
include/trace/events/thp.h+27−0
@@ -48,6 +48,33 @@ TRACE_EVENT(hugepage_update, · 47 unmodified lines
4848 TP_printk("hugepage update at addr 0x%lx and pte = 0x%lx clr = 0x%lx, set = 0x%lx", __entry->addr, __entry->pte, __entry->clr, __entry->set)
4949 );
5050
51+DECLARE_EVENT_CLASS(migration_pmd,
52+
53+ TP_PROTO(unsigned long addr, unsigned long pmd),
54+
55+ TP_ARGS(addr, pmd),
56+
57+ TP_STRUCT__entry(
58+ __field(unsigned long, addr)
59+ __field(unsigned long, pmd)
60+ ),
61+
62+ TP_fast_assign(
63+ __entry->addr = addr;
64+ __entry->pmd = pmd;
65+ ),
66+ TP_printk("addr=%lx, pmd=%lx", __entry->addr, __entry->pmd)
67+);
68+
69+DEFINE_EVENT(migration_pmd, set_migration_pmd,
70+ TP_PROTO(unsigned long addr, unsigned long pmd),
71+ TP_ARGS(addr, pmd)
72+);
73+
74+DEFINE_EVENT(migration_pmd, remove_migration_pmd,
75+ TP_PROTO(unsigned long addr, unsigned long pmd),
76+ TP_ARGS(addr, pmd)
77+);
5178 #endif /* _TRACE_THP_H */
5279
5380 /* This part must be outside protection */
mm/huge_memory.c+5−0
@@ -40,6 +40,9 @@ · 39 unmodified lines
4040 #include <asm/pgalloc.h>
4141 #include "internal.h"
4242
43+#define CREATE_TRACE_POINTS
44+#include <trace/events/thp.h>
45+
4346 /*
4447 * By default, transparent hugepage support is disabled in order to avoid
4548 * risking an increased memory footprint for applications that are not
@@ -3131,6 +3134,7 @@ void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, · 3085 unmodified lines
31313134 set_pmd_at(mm, address, pvmw->pmd, pmdswp);
31323135 page_remove_rmap(page, vma, true);
31333136 put_page(page);
3137+ trace_set_migration_pmd(address, pmd_val(pmdswp));
31343138 }
31353139
31363140 void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)
@@ -3163,5 +3167,6 @@ void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new) · 26 unmodified lines
31633167
31643168 /* No need to invalidate - it was non-present before */
31653169 update_mmu_cache_pmd(vma, address, pvmw->pmd);
3170+ trace_remove_migration_pmd(address, pmd_val(pmde));
31663171 }
31673172 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t