ANDROID: vendor_hook: Add hook in inactive_is_low()

Provide a vendor hook android_vh_inactive_is_low to replace the
calculation process of inactive_ratio.
The alternative calculation algorithm takes into account the
difference between file pages and anonymous pages.

Bug: 234214858
Signed-off-by: Bing Han <bing.han@transsion.com>
Change-Id: I6cf9c47fbc440852cc36e04f49d644146eb2c6af
This commit is contained in:
Bing Han
2022-05-30 14:06:14 +08:00
committed by Treehugger Robot
parent bb9c8f5256
commit 6b04959511
3 changed files with 11 additions and 0 deletions

View File

@@ -34,6 +34,10 @@ DECLARE_HOOK(android_vh_shrink_node_memcgs,
DECLARE_HOOK(android_vh_tune_memcg_scan_type,
TP_PROTO(struct mem_cgroup *memcg, char *scan_type),
TP_ARGS(memcg, scan_type));
DECLARE_HOOK(android_vh_inactive_is_low,
TP_PROTO(unsigned long gb, unsigned long *inactive_ratio,
enum lru_list inactive_lru, bool *skip),
TP_ARGS(gb, inactive_ratio, inactive_lru, skip));
#endif /* _TRACE_HOOK_VMSCAN_H */
/* This part must be outside protection */
#include <trace/define_trace.h>