ANDROID: cgroup: add vendor hook to cgroup .attach()

Add a vendor hook when a set of tasks change the cgroups in
the controller for performance tuning.

Bug: 187972571
Signed-off-by: Jing-Ting Wu <Jing-Ting.Wu@mediatek.com>
Change-Id: If0ea3d089e077a4650507c69b6e60952d102fa1d
This commit is contained in:
Jing-Ting Wu 2021-05-14 10:48:33 +08:00 committed by Todd Kjos
commit 2bb462a3af
3 changed files with 8 additions and 0 deletions

View file

@ -276,3 +276,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_is_initialized);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_of_i2c_get_board_info);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);

View file

@ -18,6 +18,12 @@ DECLARE_RESTRICTED_HOOK(android_rvh_cpuset_fork,
DECLARE_RESTRICTED_HOOK(android_rvh_cgroup_force_kthread_migration,
TP_PROTO(struct task_struct *tsk, struct cgroup *dst_cgrp, bool *force_migration),
TP_ARGS(tsk, dst_cgrp, force_migration), 1);
struct cgroup_subsys;
struct cgroup_taskset;
DECLARE_HOOK(android_vh_cgroup_attach,
TP_PROTO(struct cgroup_subsys *ss, struct cgroup_taskset *tset),
TP_ARGS(ss, tset))
#endif
#include <trace/define_trace.h>

View file

@ -2452,6 +2452,7 @@ static int cgroup_migrate_execute(struct cgroup_mgctx *mgctx)
do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
if (ss->attach) {
tset->ssid = ssid;
trace_android_vh_cgroup_attach(ss, tset);
ss->attach(tset);
}
} while_each_subsys_mask();