ANDROID: vendor_hooks: add vendor hook for supporting customize alloc_gfp at alloc_page_slowpath

add vendor hook for supporting customize alloc_gfp at alloc_page_slowpath,
give the ability to customize alloc_gfp according to customer specific requirement.

Bug: 337192903
Bug: 395197442
Change-Id: I42fd97fa76a47b9fde554434f607285bee8915c0
Signed-off-by: wei li <liwei1234@oppo.com>
Signed-off-by: wengle <wengle@oppo.com>
This commit is contained in:
wei li
2024-04-26 18:08:00 +08:00
committed by Todd Kjos
parent f94277018a
commit 62a9b99ed8
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -434,3 +434,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_vmscan_kswapd_wake);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_vmscan_kswapd_done);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_customize_alloc_gfp);
+4
View File
@@ -381,6 +381,10 @@ DECLARE_HOOK(android_vh_save_track_hash,
DECLARE_HOOK(android_vh_adjust_kvmalloc_flags,
TP_PROTO(unsigned int order, gfp_t *alloc_flags),
TP_ARGS(order, alloc_flags));
DECLARE_HOOK(android_vh_customize_alloc_gfp,
TP_PROTO(gfp_t *alloc_gfp, unsigned int order),
TP_ARGS(alloc_gfp, order));
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */
+1
View File
@@ -5094,6 +5094,7 @@ struct page *__alloc_pages_noprof(gfp_t gfp, unsigned int order,
* &cpuset_current_mems_allowed to optimize the fast-path attempt.
*/
ac.nodemask = nodemask;
trace_android_vh_customize_alloc_gfp(&alloc_gfp, order);
page = __alloc_pages_slowpath(alloc_gfp, order, &ac);