Skip to content

Commit b413d48

Browse files
koct9itorvalds
authored andcommitted
mm-tracepoint: rename page-free events
Rename mm_page_free_direct into mm_page_free and mm_pagevec_free into mm_page_free_batched Since v2.6.33-5426-gc475dab the kernel triggers mm_page_free_direct for all freed pages, not only for directly freed. So, let's name it properly. For pages freed via page-list we also trigger mm_page_free_batched event. Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Mel Gorman <mel@csn.ul.ie> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent da066ad commit b413d48

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎Documentation/trace/events-kmem.txt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ but the call_site can usually be used to extrapolate that information.
4040
==================
4141
mm_page_alloc page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s
4242
mm_page_alloc_zone_locked page=%p pfn=%lu order=%u migratetype=%d cpu=%d percpu_refill=%d
43-
mm_page_free_direct page=%p pfn=%lu order=%d
44-
mm_pagevec_free page=%p pfn=%lu order=%d cold=%d
43+
mm_page_free page=%p pfn=%lu order=%d
44+
mm_page_free_batched page=%p pfn=%lu order=%d cold=%d
4545

4646
These four events deal with page allocation and freeing. mm_page_alloc is
4747
a simple indicator of page allocator activity. Pages may be allocated from
@@ -53,13 +53,13 @@ amounts of activity imply high activity on the zone->lock. Taking this lock
5353
impairs performance by disabling interrupts, dirtying cache lines between
5454
CPUs and serialising many CPUs.
5555

56-
When a page is freed directly by the caller, the mm_page_free_direct event
56+
When a page is freed directly by the caller, the only mm_page_free event
5757
is triggered. Significant amounts of activity here could indicate that the
5858
callers should be batching their activities.
5959

60-
When pages are freed using a pagevec, the mm_pagevec_free is
61-
triggered. Broadly speaking, pages are taken off the LRU lock in bulk and
62-
freed in batch with a pagevec. Significant amounts of activity here could
60+
When pages are freed in batch, the also mm_page_free_batched is triggered.
61+
Broadly speaking, pages are taken off the LRU lock in bulk and
62+
freed in batch with a page list. Significant amounts of activity here could
6363
indicate that the system is under memory pressure and can also indicate
6464
contention on the zone->lru_lock.
6565

‎Documentation/trace/postprocess/trace-pagealloc-postprocess.pl‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
# Tracepoint events
1919
use constant MM_PAGE_ALLOC => 1;
20-
use constant MM_PAGE_FREE_DIRECT => 2;
21-
use constant MM_PAGEVEC_FREE => 3;
20+
use constant MM_PAGE_FREE => 2;
21+
use constant MM_PAGE_FREE_BATCHED => 3;
2222
use constant MM_PAGE_PCPU_DRAIN => 4;
2323
use constant MM_PAGE_ALLOC_ZONE_LOCKED => 5;
2424
use constant MM_PAGE_ALLOC_EXTFRAG => 6;
@@ -223,10 +223,10 @@ sub process_events {
223223
# Perl Switch() sucks majorly
224224
if ($tracepoint eq "mm_page_alloc") {
225225
$perprocesspid{$process_pid}->{MM_PAGE_ALLOC}++;
226-
} elsif ($tracepoint eq "mm_page_free_direct") {
227-
$perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT}++;
228-
} elsif ($tracepoint eq "mm_pagevec_free") {
229-
$perprocesspid{$process_pid}->{MM_PAGEVEC_FREE}++;
226+
} elsif ($tracepoint eq "mm_page_free") {
227+
$perprocesspid{$process_pid}->{MM_PAGE_FREE}++
228+
} elsif ($tracepoint eq "mm_page_free_batched") {
229+
$perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED}++;
230230
} elsif ($tracepoint eq "mm_page_pcpu_drain") {
231231
$perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN}++;
232232
$perprocesspid{$process_pid}->{STATE_PCPU_PAGES_DRAINED}++;
@@ -336,8 +336,8 @@ sub dump_stats {
336336
$process_pid,
337337
$stats{$process_pid}->{MM_PAGE_ALLOC},
338338
$stats{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED},
339-
$stats{$process_pid}->{MM_PAGE_FREE_DIRECT},
340-
$stats{$process_pid}->{MM_PAGEVEC_FREE},
339+
$stats{$process_pid}->{MM_PAGE_FREE},
340+
$stats{$process_pid}->{MM_PAGE_FREE_BATCHED},
341341
$stats{$process_pid}->{MM_PAGE_PCPU_DRAIN},
342342
$stats{$process_pid}->{HIGH_PCPU_DRAINS},
343343
$stats{$process_pid}->{HIGH_PCPU_REFILLS},
@@ -364,8 +364,8 @@ ()
364364

365365
$perprocess{$process}->{MM_PAGE_ALLOC} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC};
366366
$perprocess{$process}->{MM_PAGE_ALLOC_ZONE_LOCKED} += $perprocesspid{$process_pid}->{MM_PAGE_ALLOC_ZONE_LOCKED};
367-
$perprocess{$process}->{MM_PAGE_FREE_DIRECT} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_DIRECT};
368-
$perprocess{$process}->{MM_PAGEVEC_FREE} += $perprocesspid{$process_pid}->{MM_PAGEVEC_FREE};
367+
$perprocess{$process}->{MM_PAGE_FREE} += $perprocesspid{$process_pid}->{MM_PAGE_FREE};
368+
$perprocess{$process}->{MM_PAGE_FREE_BATCHED} += $perprocesspid{$process_pid}->{MM_PAGE_FREE_BATCHED};
369369
$perprocess{$process}->{MM_PAGE_PCPU_DRAIN} += $perprocesspid{$process_pid}->{MM_PAGE_PCPU_DRAIN};
370370
$perprocess{$process}->{HIGH_PCPU_DRAINS} += $perprocesspid{$process_pid}->{HIGH_PCPU_DRAINS};
371371
$perprocess{$process}->{HIGH_PCPU_REFILLS} += $perprocesspid{$process_pid}->{HIGH_PCPU_REFILLS};

‎include/trace/events/kmem.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ DEFINE_EVENT(kmem_free, kmem_cache_free,
147147
TP_ARGS(call_site, ptr)
148148
);
149149

150-
TRACE_EVENT(mm_page_free_direct,
150+
TRACE_EVENT(mm_page_free,
151151

152152
TP_PROTO(struct page *page, unsigned int order),
153153

@@ -169,7 +169,7 @@ TRACE_EVENT(mm_page_free_direct,
169169
__entry->order)
170170
);
171171

172-
TRACE_EVENT(mm_pagevec_free,
172+
TRACE_EVENT(mm_page_free_batched,
173173

174174
TP_PROTO(struct page *page, int cold),
175175

‎mm/page_alloc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
632632
int i;
633633
int bad = 0;
634634

635-
trace_mm_page_free_direct(page, order);
635+
trace_mm_page_free(page, order);
636636
kmemcheck_free_shadow(page, order);
637637

638638
if (PageAnon(page))
@@ -1196,7 +1196,7 @@ void free_hot_cold_page_list(struct list_head *list, int cold)
11961196
struct page *page, *next;
11971197

11981198
list_for_each_entry_safe(page, next, list, lru) {
1199-
trace_mm_pagevec_free(page, cold);
1199+
trace_mm_page_free_batched(page, cold);
12001200
free_hot_cold_page(page, cold);
12011201
}
12021202
}

0 commit comments

Comments
 (0)