ANDROID: vendor_hooks: tune reclaim scan type for specified mem_cgroup

Add memcg support for hooks in the reclaim path

Bug: 230450931
Change-Id: Ia3e6949985d915c8640139fbb93800d91e1e46f8
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
This commit is contained in:
xiaofeng 2022-07-20 11:38:10 +08:00 committed by Suren Baghdasaryan
parent dd2468d119
commit 9c6d1cf9ff
3 changed files with 5 additions and 0 deletions

View File

@ -407,3 +407,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_alloc_new_buf_locked);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_reply);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_trans);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_preset);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type);

View File

@ -34,6 +34,9 @@ DECLARE_HOOK(android_vh_shrink_slab_bypass,
DECLARE_HOOK(android_vh_do_shrink_slab,
TP_PROTO(struct shrinker *shrinker, struct shrink_control *shrinkctl, int priority),
TP_ARGS(shrinker, shrinkctl, priority));
DECLARE_HOOK(android_vh_tune_memcg_scan_type,
TP_PROTO(struct mem_cgroup *memcg, char *scan_type),
TP_ARGS(memcg, scan_type));
#endif /* _TRACE_HOOK_VMSCAN_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -2807,6 +2807,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
denominator = ap + fp;
out:
trace_android_vh_tune_scan_type((char *)(&scan_balance));
trace_android_vh_tune_memcg_scan_type(memcg, (char *)(&scan_balance));
for_each_evictable_lru(lru) {
int file = is_file_lru(lru);
unsigned long lruvec_size;