ANDROID: vendor_hooks:vendor hook for mmput

add vendor hook in mmput while mm_users decreased to 0.

Bug: 238821038
Change-Id: I42a717cbeeb3176bac14b4b2391fdb2366c972d3
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
This commit is contained in:
xiaofeng 2022-07-13 10:23:51 +08:00 committed by Suren Baghdasaryan
parent 571c04e945
commit ec196511bf
3 changed files with 8 additions and 1 deletions

View file

@ -376,6 +376,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_effective_cpu_util,
struct task_struct *p, unsigned long *new_util),
TP_ARGS(cpu, util_cfs, max, type, p, new_util), 1);
DECLARE_HOOK(android_vh_mmput,
TP_PROTO(struct mm_struct *mm),
TP_ARGS(mm));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View file

@ -1222,8 +1222,10 @@ void mmput(struct mm_struct *mm)
{
might_sleep();
if (atomic_dec_and_test(&mm->mm_users))
if (atomic_dec_and_test(&mm->mm_users)) {
trace_android_vh_mmput(mm);
__mmput(mm);
}
}
EXPORT_SYMBOL_GPL(mmput);

View file

@ -96,3 +96,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dup_task_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_irqtime_account_process_tick);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_effective_cpu_util);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput);