ANDROID: mm: Add vendor hook for compact pages work.

To monitor the efficiency of each action about compaction.
Add the vendor_hook function and call it in kcompactd_do_work() and
try_to_compact_pages()

ANDROID vendor hook
android_vh_compaction_exit(int, int, const int)
android_vh_compaction_try_to_compact_exit(enum *compact result)

Bug: 301044280
Bug: 330661608
Bug: 411525596
Change-Id: I4c3f94e77eb2b16ba154ba88a9f75095536de916
Signed-off-by: John Hsu <john.hsu@mediatek.com>
Signed-off-by: Chinwen Chang <chinwen.chang@mediatek.com>
This commit is contained in:
JohnHsu
2023-09-25 14:08:53 +08:00
committed by Treehugger Robot
parent ba971cd36a
commit c90ae2df48
3 changed files with 11 additions and 1 deletions
+2
View File
@@ -496,3 +496,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_rwsem_reader_owned);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_writer_owned);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_rwsem_writer_owned);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_read_trylock_failed);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_compaction_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_compaction_try_to_compact_exit);
+7
View File
@@ -12,6 +12,13 @@
DECLARE_HOOK(android_vh_proactive_compact_wmark_high,
TP_PROTO(int *wmark_high),
TP_ARGS(wmark_high));
DECLARE_HOOK(android_vh_compaction_exit,
TP_PROTO(int node_id, int order, const int highest_zoneidx),
TP_ARGS(node_id, order, highest_zoneidx));
enum compact_result;
DECLARE_HOOK(android_vh_compaction_try_to_compact_exit,
TP_PROTO(enum compact_result *compact_result),
TP_ARGS(compact_result));
#endif /* _TRACE_HOOK_COMPACTION_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
+2 -1
View File
@@ -2896,7 +2896,7 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
|| fatal_signal_pending(current))
break;
}
trace_android_vh_compaction_try_to_compact_exit(&rc);
return rc;
}
@@ -3166,6 +3166,7 @@ static void kcompactd_do_work(pg_data_t *pgdat)
count_compact_events(KCOMPACTD_FREE_SCANNED,
cc.total_free_scanned);
}
trace_android_vh_compaction_exit(pgdat->node_id, cc.order, cc.highest_zoneidx);
/*
* Regardless of success, we are done until woken up next. But remember