summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2017-02-22 18:44:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-22 19:41:29 -0500
commitdcec0b60a8213aeb876823a15d834009fce3b36e (patch)
treea6096b9f0479415a9070878ebb780fe44f39c3da /include/trace
parent5bccd16657e893e52e96547e7c2b5729d78d4e45 (diff)
mm, vmscan: add mm_vmscan_inactive_list_is_low tracepoint
Currently we have tracepoints for both active and inactive LRU lists reclaim but we do not have any which would tell us why we we decided to age the active list. Without that it is quite hard to diagnose active/inactive lists balancing. Add mm_vmscan_inactive_list_is_low tracepoint to tell us this information. Link: http://lkml.kernel.org/r/20170104101942.4860-8-mhocko@kernel.org Signed-off-by: Michal Hocko <mhocko@suse.com> Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com> Acked-by: Mel Gorman <mgorman@suse.de> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/vmscan.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 08c1cd5af0d6..27e8a5c77579 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -15,6 +15,7 @@
15#define RECLAIM_WB_MIXED 0x0010u 15#define RECLAIM_WB_MIXED 0x0010u
16#define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ 16#define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */
17#define RECLAIM_WB_ASYNC 0x0008u 17#define RECLAIM_WB_ASYNC 0x0008u
18#define RECLAIM_WB_LRU (RECLAIM_WB_ANON|RECLAIM_WB_FILE)
18 19
19#define show_reclaim_flags(flags) \ 20#define show_reclaim_flags(flags) \
20 (flags) ? __print_flags(flags, "|", \ 21 (flags) ? __print_flags(flags, "|", \
@@ -426,6 +427,45 @@ TRACE_EVENT(mm_vmscan_lru_shrink_active,
426 show_reclaim_flags(__entry->reclaim_flags)) 427 show_reclaim_flags(__entry->reclaim_flags))
427); 428);
428 429
430TRACE_EVENT(mm_vmscan_inactive_list_is_low,
431
432 TP_PROTO(int nid, int reclaim_idx,
433 unsigned long total_inactive, unsigned long inactive,
434 unsigned long total_active, unsigned long active,
435 unsigned long ratio, int file),
436
437 TP_ARGS(nid, reclaim_idx, total_inactive, inactive, total_active, active, ratio, file),
438
439 TP_STRUCT__entry(
440 __field(int, nid)
441 __field(int, reclaim_idx)
442 __field(unsigned long, total_inactive)
443 __field(unsigned long, inactive)
444 __field(unsigned long, total_active)
445 __field(unsigned long, active)
446 __field(unsigned long, ratio)
447 __field(int, reclaim_flags)
448 ),
449
450 TP_fast_assign(
451 __entry->nid = nid;
452 __entry->reclaim_idx = reclaim_idx;
453 __entry->total_inactive = total_inactive;
454 __entry->inactive = inactive;
455 __entry->total_active = total_active;
456 __entry->active = active;
457 __entry->ratio = ratio;
458 __entry->reclaim_flags = trace_shrink_flags(file) & RECLAIM_WB_LRU;
459 ),
460
461 TP_printk("nid=%d reclaim_idx=%d total_inactive=%ld inactive=%ld total_active=%ld active=%ld ratio=%ld flags=%s",
462 __entry->nid,
463 __entry->reclaim_idx,
464 __entry->total_inactive, __entry->inactive,
465 __entry->total_active, __entry->active,
466 __entry->ratio,
467 show_reclaim_flags(__entry->reclaim_flags))
468);
429#endif /* _TRACE_VMSCAN_H */ 469#endif /* _TRACE_VMSCAN_H */
430 470
431/* This part must be outside protection */ 471/* This part must be outside protection */