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
Change-Id: Ic54d35128e458661fc2b641809f5371b1d9a488e
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
This commit is contained in:
Jiewen Wang 2023-08-02 19:40:04 +08:00 committed by Suren Baghdasaryan
parent 5e1d25ac2a
commit dbb09068c1
3 changed files with 6 additions and 0 deletions

View file

@ -319,3 +319,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_folio_look_around_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_look_around);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_look_around_migrate_folio);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_test_clear_look_around_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_scan_type);

View file

@ -39,6 +39,10 @@ DECLARE_HOOK(android_vh_file_is_tiny_bypass,
DECLARE_HOOK(android_vh_check_folio_look_around_ref,
TP_PROTO(struct folio *folio, int *skip),
TP_ARGS(folio, skip));
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>

View file

@ -3020,6 +3020,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) {
int file = is_file_lru(lru);
unsigned long lruvec_size;