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: 364225494
Change-Id: Id4a7db386d74e9fb8d104e5311a585a4a48811ef
Signed-off-by: Justin Jiang <justinjiang@vivo.corp-partner.google.com>
This commit is contained in:
Justin Jiang 2024-09-03 19:30:03 +08:00 committed by Treehugger Robot
parent 23a331c4df
commit 1a958c7b34
3 changed files with 5 additions and 0 deletions

View File

@ -542,3 +542,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_customize_thp_pcp_order);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_customize_thp_gfp_orders);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_adjust_zone_wmark);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ksys_umount);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_group_exit);

View File

@ -390,6 +390,9 @@ DECLARE_HOOK(android_vh_customize_thp_gfp_orders,
DECLARE_HOOK(android_vh_init_adjust_zone_wmark,
TP_PROTO(struct zone *zone, u64 interval),
TP_ARGS(zone, interval));
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

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