ANDROID: vendor_hooks: add hook to balance_dirty_pages()

Add vendor hook in order to track which process cause dirty page write
back pressure.

Bug: 188096764
Change-Id: I890299c97d7a8cf791f20d16d8d53b4615679b9e
Signed-off-by: Yang Yang <yang.yang@vivo.com>
This commit is contained in:
Yang Yang
2021-05-13 19:28:11 +08:00
committed by Suren Baghdasaryan
parent dc5241048f
commit 1b6f2f6e29
3 changed files with 14 additions and 0 deletions

View File

@@ -282,3 +282,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_of_i2c_get_board_info); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_of_i2c_get_board_info);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_dirty_limits);

View File

@@ -71,6 +71,13 @@ struct slabinfo;
DECLARE_HOOK(android_vh_cache_show, DECLARE_HOOK(android_vh_cache_show,
TP_PROTO(struct seq_file *m, struct slabinfo *sinfo, struct kmem_cache *s), TP_PROTO(struct seq_file *m, struct slabinfo *sinfo, struct kmem_cache *s),
TP_ARGS(m, sinfo, s)); TP_ARGS(m, sinfo, s));
struct dirty_throttle_control;
DECLARE_HOOK(android_vh_mm_dirty_limits,
TP_PROTO(struct dirty_throttle_control *const gdtc, bool strictlimit,
unsigned long dirty, unsigned long bg_thresh,
unsigned long nr_reclaimable, unsigned long pages_dirtied),
TP_ARGS(gdtc, strictlimit, dirty, bg_thresh,
nr_reclaimable, pages_dirtied));
/* macro versions of hooks are no longer required */ /* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_MM_H */ #endif /* _TRACE_HOOK_MM_H */

View File

@@ -42,6 +42,9 @@
#include "internal.h" #include "internal.h"
#undef CREATE_TRACE_POINT
#include <trace/hooks/mm.h>
/* /*
* Sleep at most 200ms at a time in balance_dirty_pages(). * Sleep at most 200ms at a time in balance_dirty_pages().
*/ */
@@ -1625,6 +1628,9 @@ static void balance_dirty_pages(struct bdi_writeback *wb,
} }
} }
trace_android_vh_mm_dirty_limits(gdtc, strictlimit, dirty, bg_thresh,
nr_reclaimable, pages_dirtied);
/* /*
* Throttle it only when the background writeback cannot * Throttle it only when the background writeback cannot
* catch-up. This avoids (excessively) small writeouts * catch-up. This avoids (excessively) small writeouts