ANDROID: vendor_hooks: Add tune scan type hook in get_scan_count()

Add hook in get_scan_count() for oem to wield customized reclamation strategy

Bug: 294180281
Bug: 336401947
Change-Id: Ic54d35128e458661fc2b641809f5371b1d9a488e
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
Signed-off-by: huzhanyuan <huzhanyuan@oppo.com>
This commit is contained in:
Jiewen Wang
2023-08-02 19:40:04 +08:00
committed by Treehugger Robot
parent ba0a4c3d8a
commit e140f1a43f
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -229,6 +229,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue_smallest_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_one_page_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_migration_target_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_adjust_alloc_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_scan_type);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wait_for_work);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_oem_binder_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_received);
+4
View File
@@ -52,6 +52,10 @@ DECLARE_HOOK(android_vh_tune_scan_control,
DECLARE_HOOK(android_vh_page_referenced_check_bypass,
TP_PROTO(struct folio *folio, unsigned long nr_to_scan, int lru, bool *bypass),
TP_ARGS(folio, nr_to_scan, lru, bypass));
enum scan_balance;
DECLARE_HOOK(android_vh_tune_scan_type,
TP_PROTO(enum scan_balance *scan_type),
TP_ARGS(scan_type));
#endif /* _TRACE_HOOK_VMSCAN_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
+1
View File
@@ -2508,6 +2508,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
fraction[1] = fp;
denominator = ap + fp;
out:
trace_android_vh_tune_scan_type(&scan_balance);
for_each_evictable_lru(lru) {
bool file = is_file_lru(lru);
unsigned long lruvec_size;