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
3 * This file is for defining trace points and trace related helpers.3 * This file is for defining trace points and trace related helpers.
4 */4 */
5#ifdef CONFIG_TRANSPARENT_HUGEPAGE5#ifdef CONFIG_TRANSPARENT_HUGEPAGE
6#define CREATE_TRACE_POINTS
7#include <trace/events/thp.h>6#include <trace/events/thp.h>
8#endif7#endif
include/trace/events/thp.h+27−0
@@ -48,6 +48,33 @@ TRACE_EVENT(hugepage_update, · 47 unmodified lines
48 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)48 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)
49);49);
50 50
51DECLARE_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
69DEFINE_EVENT(migration_pmd, set_migration_pmd,
70 TP_PROTO(unsigned long addr, unsigned long pmd),
71 TP_ARGS(addr, pmd)
72);
73
74DEFINE_EVENT(migration_pmd, remove_migration_pmd,
75 TP_PROTO(unsigned long addr, unsigned long pmd),
76 TP_ARGS(addr, pmd)
77);
51#endif /* _TRACE_THP_H */78#endif /* _TRACE_THP_H */
52 79
53/* This part must be outside protection */80/* This part must be outside protection */
mm/huge_memory.c+5−0
@@ -40,6 +40,9 @@ · 39 unmodified lines
40#include <asm/pgalloc.h>40#include <asm/pgalloc.h>
41#include "internal.h"41#include "internal.h"
42 42
43#define CREATE_TRACE_POINTS
44#include <trace/events/thp.h>
45
43/*46/*
44 * By default, transparent hugepage support is disabled in order to avoid47 * By default, transparent hugepage support is disabled in order to avoid
45 * risking an increased memory footprint for applications that are not48 * 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
3131 set_pmd_at(mm, address, pvmw->pmd, pmdswp);3134 set_pmd_at(mm, address, pvmw->pmd, pmdswp);
3132 page_remove_rmap(page, vma, true);3135 page_remove_rmap(page, vma, true);
3133 put_page(page);3136 put_page(page);
3137 trace_set_migration_pmd(address, pmd_val(pmdswp));
3134}3138}
3135 3139
3136void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)3140void 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
3163 3167
3164 /* No need to invalidate - it was non-present before */3168 /* No need to invalidate - it was non-present before */
3165 update_mmu_cache_pmd(vma, address, pvmw->pmd);3169 update_mmu_cache_pmd(vma, address, pvmw->pmd);
3170 trace_remove_migration_pmd(address, pmd_val(pmde));
3166}3171}
3167#endif3172#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