ANDROID: GKI: add vendor hooks android_vh_page_should_be_protected() and android_vh_page_referenced_check_bypass().

add two vendor hooks:
    android_vh_page_should_be_protected():protect pages from memory
reclaim.
    android_vh_page_referenced_check_bypass():bypass rmap in active list
shrink.

The new vendor data field in scan_control are used to track how many
pages are protected in current reclaim and the "protected / scanned"
rate. These parameters are useful for understanding the impact of page
protection operations on LRU and reclaim, helping us make better
decsions.

Bug: 399782297
Change-Id: I49567a4b1f978821a94da0a8339b2b8fdfd52daf
Signed-off-by: Yuxuan Yan <yanyuxuan3@xiaomi.corp-partner.google.com>
This commit is contained in:
Yuxuan Yan
2024-06-20 14:44:17 +08:00
committed by Todd Kjos
parent 3c2ff5314e
commit 2189ba4dcc
4 changed files with 30 additions and 0 deletions
+4
View File
@@ -235,6 +235,10 @@ DECLARE_HOOK(android_vh_free_pages_ok_bypass,
DECLARE_HOOK(android_vh_split_large_folio_bypass,
TP_PROTO(bool *bypass),
TP_ARGS(bypass));
DECLARE_HOOK(android_vh_page_should_be_protected,
TP_PROTO(struct folio *folio, unsigned long nr_scanned,
s8 priority, u64 *ext, int *should_protect),
TP_ARGS(folio, nr_scanned, priority, ext, should_protect));
DECLARE_HOOK(android_vh_do_read_fault,
TP_PROTO(struct vm_fault *vmf, unsigned long fault_around_bytes),
TP_ARGS(vmf, fault_around_bytes));
+3
View File
@@ -49,6 +49,9 @@ DECLARE_HOOK(android_vh_use_vm_swappiness,
DECLARE_HOOK(android_vh_tune_scan_control,
TP_PROTO(bool *skip_swap),
TP_ARGS(skip_swap));
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));
#endif /* _TRACE_HOOK_VMSCAN_H */
/* This part must be outside protection */
#include <trace/define_trace.h>