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:
@@ -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));
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user