ANDROID: vendor_hooks: tune reclaim inactive ratio
Add hooks to apply oem's memory reclaim optimization Bug: 186669330 Change-Id: I9a1c713bf3eea2823b2758ee44284a244b1ca7a1 Signed-off-by: zhouhuacai <zhouohuacai@oppo.com> Signed-off-by: Oven <liyangouwen1@oppo.com> (cherry picked from commit 577f73412f579ef493e8e67795b3fd93f1a47dfd)
This commit is contained in:
@@ -460,3 +460,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_cache_forced_ra);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_acct_update_power);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio);
|
||||
|
||||
@@ -48,6 +48,9 @@ DECLARE_HOOK(android_vh_do_shrink_slab,
|
||||
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_tune_inactive_ratio,
|
||||
TP_PROTO(unsigned long *inactive_ratio, int file),
|
||||
TP_ARGS(inactive_ratio, file))
|
||||
#endif /* _TRACE_HOOK_VMSCAN_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
@@ -2611,6 +2611,8 @@ static bool inactive_is_low(struct lruvec *lruvec, enum lru_list inactive_lru)
|
||||
else
|
||||
inactive_ratio = 1;
|
||||
|
||||
trace_android_vh_tune_inactive_ratio(&inactive_ratio, is_file_lru(inactive_lru));
|
||||
|
||||
return inactive * inactive_ratio < active;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user