ANDROID: Add vendor hook for highmem movable page allocations
The associated vendor hooks are used for adjusting gfp flags during highmem movable page allocations. We would like to implement different gfp depends on CMA's size. Bug: 284797897 Test: build pass Change-Id: I7e4f748299eb4517fbc2c95dc2d7b8a21ed3d828 Signed-off-by: zhaoyang.huang <zhaoyang.huang@unisoc.com>
This commit is contained in:
committed by
Treehugger Robot
parent
43bb029673
commit
0574ecdc5e
@@ -45,6 +45,7 @@
|
||||
#include <asm/virt.h>
|
||||
|
||||
#include <trace/hooks/fault.h>
|
||||
#include <trace/hooks/mm.h>
|
||||
|
||||
struct fault_info {
|
||||
int (*fn)(unsigned long far, unsigned int esr,
|
||||
@@ -1010,6 +1011,7 @@ struct page *alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma,
|
||||
{
|
||||
gfp_t flags = GFP_HIGHUSER_MOVABLE | __GFP_ZERO | __GFP_CMA;
|
||||
|
||||
trace_android_vh_alloc_highpage_movable_gfp_adjust(&flags);
|
||||
/*
|
||||
* If the page is mapped with PROT_MTE, initialise the tags at the
|
||||
* point of allocation and page zeroing as this is usually faster than
|
||||
|
||||
@@ -415,6 +415,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_hibernation_swap);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_cpu_resume);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_hib_resume_bdev);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_highpage_movable_gfp_adjust);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dma_buf_stats_teardown);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_madvise_cold_or_pageout);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_retry);
|
||||
|
||||
@@ -180,6 +180,9 @@ DECLARE_HOOK(android_vh_free_one_page_bypass,
|
||||
DECLARE_HOOK(android_vh_use_cma_first_check,
|
||||
TP_PROTO(bool *use_cma_first_check),
|
||||
TP_ARGS(use_cma_first_check));
|
||||
DECLARE_HOOK(android_vh_alloc_highpage_movable_gfp_adjust,
|
||||
TP_PROTO(gfp_t *gfp_mask),
|
||||
TP_ARGS(gfp_mask));
|
||||
#endif /* _TRACE_HOOK_MM_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
||||
Reference in New Issue
Block a user