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 2024-05-29 20:21:30 +08:00 committed by Treehugger Robot
parent a494753f45
commit dedfeb0f68
3 changed files with 8 additions and 1 deletions

View File

@ -416,6 +416,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_context_switch,
TP_PROTO(struct task_struct *pre, struct task_struct *next),
TP_ARGS(pre, next), 1);
DECLARE_HOOK(android_vh_mmput,
TP_PROTO(void *unused),
TP_ARGS(unused));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View File

@ -1398,8 +1398,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(NULL);
__mmput(mm);
}
}
EXPORT_SYMBOL_GPL(mmput);

View File

@ -107,3 +107,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_cgroup_css_alloc);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_cgroup_css_free);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_reweight_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_context_switch);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput);