ANDROID: mm: Add vendor hooks for recording when kswapd finishing the reclaim job

To monitor the reclaiming ability of kswapd, add vendor hook recording when the kswapd finish the reclaiming job and the reclaim progress.

android_vh_vmscan_kswpad_done(int, unsigned int, unsigned int, unsigned int)

Bug: 301044280

Change-Id: Id6e0a97003f0a156cff4d0996bc38bcd89b1dc69
Signed-off-by: John Hsu <john.hsu@mediatek.com>
Signed-off-by: liwei <liwei1234@oppo.com>
(cherry picked from commit 6c3dd25d2fdeff6fc752ef74e87e22f86ae1d939)
This commit is contained in:
liwei
2023-09-25 17:28:48 +08:00
committed by Suren Baghdasaryan
parent 8cbe4885a9
commit 0a9731879a
3 changed files with 8 additions and 0 deletions

View File

@@ -513,6 +513,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_compl_rsp_check_done);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_handler);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_check_ctrl);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_print_ctrl);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmscan_kswapd_done);
/*
* For type visibility
*/

View File

@@ -53,6 +53,10 @@ DECLARE_HOOK(android_vh_snapshot_refaults,
DECLARE_HOOK(android_vh_check_page_look_around_ref,
TP_PROTO(struct page *page, int *skip),
TP_ARGS(page, skip));
DECLARE_HOOK(android_vh_vmscan_kswapd_done,
TP_PROTO(int node_id, unsigned int highest_zoneidx, unsigned int alloc_order,
unsigned int reclaim_order),
TP_ARGS(node_id, highest_zoneidx, alloc_order, reclaim_order));
#endif /* _TRACE_HOOK_VMSCAN_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@@ -68,6 +68,7 @@
EXPORT_TRACEPOINT_SYMBOL_GPL(mm_vmscan_direct_reclaim_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(mm_vmscan_direct_reclaim_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(mm_vmscan_kswapd_wake);
struct scan_control {
/* How many pages shrink_list() should reclaim */
@@ -4038,6 +4039,8 @@ kswapd_try_sleep:
alloc_order);
reclaim_order = balance_pgdat(pgdat, alloc_order,
highest_zoneidx);
trace_android_vh_vmscan_kswapd_done(pgdat->node_id, highest_zoneidx,
alloc_order, reclaim_order);
if (reclaim_order < alloc_order)
goto kswapd_try_sleep;
}