ANDROID: vendor_hooks: add vendor hook to report acr_info in cma_alloc()

Add android_vh_cma_alloc_busy_info vh after EBUSY not only useful
for profiling but also pinned page handling.

Bug: 234498088
Bug: 295917627
Signed-off-by: Edward Wu <edwardwu@realtek.com>
(cherry picked from commit 45cb58e134)
Change-Id: If1de7b63c431a79889e932ff3363314199175cce
This commit is contained in:
Edward Wu
2022-06-21 07:43:07 +08:00
committed by Todd Kjos
parent 9a7a27181e
commit ebd14a6c68
3 changed files with 6 additions and 0 deletions

View File

@@ -312,6 +312,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_alloc);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_adjust);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_busy_info);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_genl_check);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);

View File

@@ -12,6 +12,7 @@
struct oom_control;
struct slabinfo;
struct cma;
struct acr_info;
struct compact_control;
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
@@ -40,6 +41,9 @@ DECLARE_HOOK(android_vh_cma_alloc_finish,
TP_PROTO(struct cma *cma, struct page *page, unsigned long count,
unsigned int align, gfp_t gfp_mask, s64 ts),
TP_ARGS(cma, page, count, align, gfp_mask, ts));
DECLARE_HOOK(android_vh_cma_alloc_busy_info,
TP_PROTO(struct acr_info *info),
TP_ARGS(info));
DECLARE_HOOK(android_vh_meminfo_proc_show,
TP_PROTO(struct seq_file *m),
TP_ARGS(m));

View File

@@ -535,6 +535,7 @@ struct page *cma_alloc(struct cma *cma, unsigned long count,
pr_debug("%s(): memory range at %p is busy, retrying\n",
__func__, pfn_to_page(pfn));
trace_android_vh_cma_alloc_busy_info(&info);
trace_cma_alloc_busy_retry(cma->name, pfn, pfn_to_page(pfn),
count, align);