ANDROID: vendor_hooks: add hook for boost free pages mapped by the

exiting process

When the system is under high memory pressure, we observed by trace
that the execution of the exiting process will have a large number of
runnables, which will result in the inability to release the pages
mapped by it's VMA to other apps for use in the system timely.

Therefore, we hope to use this hook interface to release the
physical pages mapped by the exiting process's vma in advance, and
alleviate the tight system memory resources issues.

Bug: 418942619
Bug: 364225494
Change-Id: Id4a7db386d74e9fb8d104e5311a585a4a48811ef
Signed-off-by: Justin Jiang <justinjiang@vivo.corp-partner.google.com>
(cherry picked from commit 1a958c7b342149174e88675c983ac19a3b7efdfa)
This commit is contained in:
Justin Jiang
2024-09-03 19:30:03 +08:00
parent bf3d08843a
commit 60c1841adc
3 changed files with 5 additions and 0 deletions

View File

@@ -536,3 +536,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_may_oom_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_calculate_totalreserve_pages);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_madvise_cold_pageout_skip);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue_pcplist_override_batch);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_group_exit);

View File

@@ -484,6 +484,9 @@ DECLARE_HOOK(android_vh_lruvec_del_folio,
DECLARE_HOOK(android_vh_rmqueue_pcplist_override_batch,
TP_PROTO(int *batch),
TP_ARGS(batch));
DECLARE_HOOK(android_vh_do_group_exit,
TP_PROTO(struct task_struct *tsk),
TP_ARGS(tsk));
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */

View File

@@ -1089,6 +1089,7 @@ do_group_exit(int exit_code)
}
spin_unlock_irq(&sighand->siglock);
}
trace_android_vh_do_group_exit(current);
do_exit(exit_code);
/* NOTREACHED */