aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/trace/postprocess/trace-vmscan-postprocess.pl39
-rw-r--r--include/trace/events/vmscan.h42
-rw-r--r--mm/vmscan.c6
3 files changed, 77 insertions, 10 deletions
diff --git a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
index 1b55146d1c8..b3e73ddb156 100644
--- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
+++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl
@@ -46,7 +46,7 @@ use constant HIGH_KSWAPD_LATENCY => 20;
46use constant HIGH_KSWAPD_REWAKEUP => 21; 46use constant HIGH_KSWAPD_REWAKEUP => 21;
47use constant HIGH_NR_SCANNED => 22; 47use constant HIGH_NR_SCANNED => 22;
48use constant HIGH_NR_TAKEN => 23; 48use constant HIGH_NR_TAKEN => 23;
49use constant HIGH_NR_RECLAIM => 24; 49use constant HIGH_NR_RECLAIMED => 24;
50use constant HIGH_NR_CONTIG_DIRTY => 25; 50use constant HIGH_NR_CONTIG_DIRTY => 25;
51 51
52my %perprocesspid; 52my %perprocesspid;
@@ -58,11 +58,13 @@ my $opt_read_procstat;
58my $total_wakeup_kswapd; 58my $total_wakeup_kswapd;
59my ($total_direct_reclaim, $total_direct_nr_scanned); 59my ($total_direct_reclaim, $total_direct_nr_scanned);
60my ($total_direct_latency, $total_kswapd_latency); 60my ($total_direct_latency, $total_kswapd_latency);
61my ($total_direct_nr_reclaimed);
61my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async); 62my ($total_direct_writepage_file_sync, $total_direct_writepage_file_async);
62my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async); 63my ($total_direct_writepage_anon_sync, $total_direct_writepage_anon_async);
63my ($total_kswapd_nr_scanned, $total_kswapd_wake); 64my ($total_kswapd_nr_scanned, $total_kswapd_wake);
64my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async); 65my ($total_kswapd_writepage_file_sync, $total_kswapd_writepage_file_async);
65my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async); 66my ($total_kswapd_writepage_anon_sync, $total_kswapd_writepage_anon_async);
67my ($total_kswapd_nr_reclaimed);
66 68
67# Catch sigint and exit on request 69# Catch sigint and exit on request
68my $sigint_report = 0; 70my $sigint_report = 0;
@@ -104,7 +106,7 @@ my $regex_kswapd_wake_default = 'nid=([0-9]*) order=([0-9]*)';
104my $regex_kswapd_sleep_default = 'nid=([0-9]*)'; 106my $regex_kswapd_sleep_default = 'nid=([0-9]*)';
105my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)'; 107my $regex_wakeup_kswapd_default = 'nid=([0-9]*) zid=([0-9]*) order=([0-9]*)';
106my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)'; 108my $regex_lru_isolate_default = 'isolate_mode=([0-9]*) order=([0-9]*) nr_requested=([0-9]*) nr_scanned=([0-9]*) nr_taken=([0-9]*) contig_taken=([0-9]*) contig_dirty=([0-9]*) contig_failed=([0-9]*)';
107my $regex_lru_shrink_inactive_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*)'; 109my $regex_lru_shrink_inactive_default = 'nid=([0-9]*) zid=([0-9]*) nr_scanned=([0-9]*) nr_reclaimed=([0-9]*) priority=([0-9]*) flags=([A-Z_|]*)';
108my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)'; 110my $regex_lru_shrink_active_default = 'lru=([A-Z_]*) nr_scanned=([0-9]*) nr_rotated=([0-9]*) priority=([0-9]*)';
109my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)'; 111my $regex_writepage_default = 'page=([0-9a-f]*) pfn=([0-9]*) flags=([A-Z_|]*)';
110 112
@@ -203,8 +205,8 @@ $regex_lru_shrink_inactive = generate_traceevent_regex(
203 "vmscan/mm_vmscan_lru_shrink_inactive", 205 "vmscan/mm_vmscan_lru_shrink_inactive",
204 $regex_lru_shrink_inactive_default, 206 $regex_lru_shrink_inactive_default,
205 "nid", "zid", 207 "nid", "zid",
206 "lru", 208 "nr_scanned", "nr_reclaimed", "priority",
207 "nr_scanned", "nr_reclaimed", "priority"); 209 "flags");
208$regex_lru_shrink_active = generate_traceevent_regex( 210$regex_lru_shrink_active = generate_traceevent_regex(
209 "vmscan/mm_vmscan_lru_shrink_active", 211 "vmscan/mm_vmscan_lru_shrink_active",
210 $regex_lru_shrink_active_default, 212 $regex_lru_shrink_active_default,
@@ -375,6 +377,16 @@ EVENT_PROCESS:
375 my $nr_contig_dirty = $7; 377 my $nr_contig_dirty = $7;
376 $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; 378 $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned;
377 $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; 379 $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty;
380 } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") {
381 $details = $5;
382 if ($details !~ /$regex_lru_shrink_inactive/o) {
383 print "WARNING: Failed to parse mm_vmscan_lru_shrink_inactive as expected\n";
384 print " $details\n";
385 print " $regex_lru_shrink_inactive/o\n";
386 next;
387 }
388 my $nr_reclaimed = $4;
389 $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED} += $nr_reclaimed;
378 } elsif ($tracepoint eq "mm_vmscan_writepage") { 390 } elsif ($tracepoint eq "mm_vmscan_writepage") {
379 $details = $5; 391 $details = $5;
380 if ($details !~ /$regex_writepage/o) { 392 if ($details !~ /$regex_writepage/o) {
@@ -464,8 +476,8 @@ sub dump_stats {
464 476
465 # Print out process activity 477 # Print out process activity
466 printf("\n"); 478 printf("\n");
467 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Time"); 479 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "Process", "Direct", "Wokeup", "Pages", "Pages", "Pages", "Pages", "Time");
468 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Sync-IO", "ASync-IO", "Stalled"); 480 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s %8s %8s\n", "details", "Rclms", "Kswapd", "Scanned", "Rclmed", "Sync-IO", "ASync-IO", "Stalled");
469 foreach $process_pid (keys %stats) { 481 foreach $process_pid (keys %stats) {
470 482
471 if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) { 483 if (!$stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}) {
@@ -475,6 +487,7 @@ sub dump_stats {
475 $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}; 487 $total_direct_reclaim += $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN};
476 $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; 488 $total_wakeup_kswapd += $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD};
477 $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; 489 $total_direct_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED};
490 $total_direct_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED};
478 $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; 491 $total_direct_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
479 $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; 492 $total_direct_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
480 $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; 493 $total_direct_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
@@ -489,11 +502,12 @@ sub dump_stats {
489 $index++; 502 $index++;
490 } 503 }
491 504
492 printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8.3f", 505 printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8u %8u %8.3f",
493 $process_pid, 506 $process_pid,
494 $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN}, 507 $stats{$process_pid}->{MM_VMSCAN_DIRECT_RECLAIM_BEGIN},
495 $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}, 508 $stats{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD},
496 $stats{$process_pid}->{HIGH_NR_SCANNED}, 509 $stats{$process_pid}->{HIGH_NR_SCANNED},
510 $stats{$process_pid}->{HIGH_NR_RECLAIMED},
497 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, 511 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC},
498 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}, 512 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC},
499 $this_reclaim_delay / 1000); 513 $this_reclaim_delay / 1000);
@@ -529,8 +543,8 @@ sub dump_stats {
529 543
530 # Print out kswapd activity 544 # Print out kswapd activity
531 printf("\n"); 545 printf("\n");
532 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages"); 546 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Kswapd", "Kswapd", "Order", "Pages", "Pages", "Pages", "Pages");
533 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Sync-IO", "ASync-IO"); 547 printf("%-" . $max_strlen . "s %8s %10s %8s %8s %8s %8s\n", "Instance", "Wakeups", "Re-wakeup", "Scanned", "Rclmed", "Sync-IO", "ASync-IO");
534 foreach $process_pid (keys %stats) { 548 foreach $process_pid (keys %stats) {
535 549
536 if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) { 550 if (!$stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}) {
@@ -539,16 +553,18 @@ sub dump_stats {
539 553
540 $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}; 554 $total_kswapd_wake += $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE};
541 $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED}; 555 $total_kswapd_nr_scanned += $stats{$process_pid}->{HIGH_NR_SCANNED};
556 $total_kswapd_nr_reclaimed += $stats{$process_pid}->{HIGH_NR_RECLAIMED};
542 $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; 557 $total_kswapd_writepage_file_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
543 $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; 558 $total_kswapd_writepage_anon_sync += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
544 $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; 559 $total_kswapd_writepage_file_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
545 $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}; 560 $total_kswapd_writepage_anon_async += $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC};
546 561
547 printf("%-" . $max_strlen . "s %8d %10d %8u %8i %8u", 562 printf("%-" . $max_strlen . "s %8d %10d %8u %8u %8i %8u",
548 $process_pid, 563 $process_pid,
549 $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE}, 564 $stats{$process_pid}->{MM_VMSCAN_KSWAPD_WAKE},
550 $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP}, 565 $stats{$process_pid}->{HIGH_KSWAPD_REWAKEUP},
551 $stats{$process_pid}->{HIGH_NR_SCANNED}, 566 $stats{$process_pid}->{HIGH_NR_SCANNED},
567 $stats{$process_pid}->{HIGH_NR_RECLAIMED},
552 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}, 568 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC},
553 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC}); 569 $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} + $stats{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_ASYNC});
554 570
@@ -579,6 +595,7 @@ sub dump_stats {
579 print "\nSummary\n"; 595 print "\nSummary\n";
580 print "Direct reclaims: $total_direct_reclaim\n"; 596 print "Direct reclaims: $total_direct_reclaim\n";
581 print "Direct reclaim pages scanned: $total_direct_nr_scanned\n"; 597 print "Direct reclaim pages scanned: $total_direct_nr_scanned\n";
598 print "Direct reclaim pages reclaimed: $total_direct_nr_reclaimed\n";
582 print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n"; 599 print "Direct reclaim write file sync I/O: $total_direct_writepage_file_sync\n";
583 print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n"; 600 print "Direct reclaim write anon sync I/O: $total_direct_writepage_anon_sync\n";
584 print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n"; 601 print "Direct reclaim write file async I/O: $total_direct_writepage_file_async\n";
@@ -588,6 +605,7 @@ sub dump_stats {
588 print "\n"; 605 print "\n";
589 print "Kswapd wakeups: $total_kswapd_wake\n"; 606 print "Kswapd wakeups: $total_kswapd_wake\n";
590 print "Kswapd pages scanned: $total_kswapd_nr_scanned\n"; 607 print "Kswapd pages scanned: $total_kswapd_nr_scanned\n";
608 print "Kswapd pages reclaimed: $total_kswapd_nr_reclaimed\n";
591 print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n"; 609 print "Kswapd reclaim write file sync I/O: $total_kswapd_writepage_file_sync\n";
592 print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n"; 610 print "Kswapd reclaim write anon sync I/O: $total_kswapd_writepage_anon_sync\n";
593 print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n"; 611 print "Kswapd reclaim write file async I/O: $total_kswapd_writepage_file_async\n";
@@ -612,6 +630,7 @@ sub aggregate_perprocesspid() {
612 $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD}; 630 $perprocess{$process}->{MM_VMSCAN_WAKEUP_KSWAPD} += $perprocesspid{$process_pid}->{MM_VMSCAN_WAKEUP_KSWAPD};
613 $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP}; 631 $perprocess{$process}->{HIGH_KSWAPD_REWAKEUP} += $perprocesspid{$process_pid}->{HIGH_KSWAPD_REWAKEUP};
614 $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED}; 632 $perprocess{$process}->{HIGH_NR_SCANNED} += $perprocesspid{$process_pid}->{HIGH_NR_SCANNED};
633 $perprocess{$process}->{HIGH_NR_RECLAIMED} += $perprocesspid{$process_pid}->{HIGH_NR_RECLAIMED};
615 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC}; 634 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_SYNC};
616 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC}; 635 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_ANON_SYNC};
617 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC}; 636 $perprocess{$process}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC} += $perprocesspid{$process_pid}->{MM_VMSCAN_WRITEPAGE_FILE_ASYNC};
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 370aa5a8732..ecf952192a9 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -10,6 +10,7 @@
10 10
11#define RECLAIM_WB_ANON 0x0001u 11#define RECLAIM_WB_ANON 0x0001u
12#define RECLAIM_WB_FILE 0x0002u 12#define RECLAIM_WB_FILE 0x0002u
13#define RECLAIM_WB_MIXED 0x0010u
13#define RECLAIM_WB_SYNC 0x0004u 14#define RECLAIM_WB_SYNC 0x0004u
14#define RECLAIM_WB_ASYNC 0x0008u 15#define RECLAIM_WB_ASYNC 0x0008u
15 16
@@ -17,6 +18,7 @@
17 (flags) ? __print_flags(flags, "|", \ 18 (flags) ? __print_flags(flags, "|", \
18 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \ 19 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \
19 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \ 20 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \
21 {RECLAIM_WB_MIXED, "RECLAIM_WB_MIXED"}, \
20 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \ 22 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \
21 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \ 23 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \
22 ) : "RECLAIM_WB_NONE" 24 ) : "RECLAIM_WB_NONE"
@@ -26,6 +28,12 @@
26 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ 28 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
27 ) 29 )
28 30
31#define trace_shrink_flags(file, sync) ( \
32 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_MIXED : \
33 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \
34 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
35 )
36
29TRACE_EVENT(mm_vmscan_kswapd_sleep, 37TRACE_EVENT(mm_vmscan_kswapd_sleep,
30 38
31 TP_PROTO(int nid), 39 TP_PROTO(int nid),
@@ -269,6 +277,40 @@ TRACE_EVENT(mm_vmscan_writepage,
269 show_reclaim_flags(__entry->reclaim_flags)) 277 show_reclaim_flags(__entry->reclaim_flags))
270); 278);
271 279
280TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
281
282 TP_PROTO(int nid, int zid,
283 unsigned long nr_scanned, unsigned long nr_reclaimed,
284 int priority, int reclaim_flags),
285
286 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
287
288 TP_STRUCT__entry(
289 __field(int, nid)
290 __field(int, zid)
291 __field(unsigned long, nr_scanned)
292 __field(unsigned long, nr_reclaimed)
293 __field(int, priority)
294 __field(int, reclaim_flags)
295 ),
296
297 TP_fast_assign(
298 __entry->nid = nid;
299 __entry->zid = zid;
300 __entry->nr_scanned = nr_scanned;
301 __entry->nr_reclaimed = nr_reclaimed;
302 __entry->priority = priority;
303 __entry->reclaim_flags = reclaim_flags;
304 ),
305
306 TP_printk("nid=%d zid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s",
307 __entry->nid, __entry->zid,
308 __entry->nr_scanned, __entry->nr_reclaimed,
309 __entry->priority,
310 show_reclaim_flags(__entry->reclaim_flags))
311);
312
313
272#endif /* _TRACE_VMSCAN_H */ 314#endif /* _TRACE_VMSCAN_H */
273 315
274/* This part must be outside protection */ 316/* This part must be outside protection */
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 28b0521e4bf..4a6dccb5758 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1358,6 +1358,12 @@ shrink_inactive_list(unsigned long nr_to_scan, struct zone *zone,
1358 __count_zone_vm_events(PGSTEAL, zone, nr_reclaimed); 1358 __count_zone_vm_events(PGSTEAL, zone, nr_reclaimed);
1359 1359
1360 putback_lru_pages(zone, sc, nr_anon, nr_file, &page_list); 1360 putback_lru_pages(zone, sc, nr_anon, nr_file, &page_list);
1361
1362 trace_mm_vmscan_lru_shrink_inactive(zone->zone_pgdat->node_id,
1363 zone_idx(zone),
1364 nr_scanned, nr_reclaimed,
1365 priority,
1366 trace_shrink_flags(file, sc->lumpy_reclaim_mode));
1361 return nr_reclaimed; 1367 return nr_reclaimed;
1362} 1368}
1363 1369