ANDROID: mm: Add vendor hook in rmqueue()

Add a vendor hook for costly order page counting
and other vendor specific functions.

Bug: 174521902
Bug: 172987241
Bug: 244409558
Signed-off-by: Chiawei Wang <chiaweiwang@google.com>
Signed-off-by: Oven <liyangouwen1@oppo.com>
Change-Id: I89206727a462548cc3500b695d85c83ff003eec7
(cherry picked from commit 369de3780428a17e9afece2f5747f03619d589b6)
This commit is contained in:
Chiawei Wang
2021-02-18 10:43:50 +08:00
committed by Suren Baghdasaryan
parent 193dcfee4d
commit fb2bb8f3ad
3 changed files with 9 additions and 0 deletions

View File

@@ -360,4 +360,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_cache_forced_ra);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_acct_update_power);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio);

View File

@@ -129,6 +129,12 @@ DECLARE_HOOK(android_vh_alloc_pages_failure_bypass,
TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags,
int migratetype, struct page **page),
TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page));
DECLARE_HOOK(android_vh_rmqueue,
TP_PROTO(struct zone *preferred_zone, struct zone *zone,
unsigned int order, gfp_t gfp_flags,
unsigned int alloc_flags, int migratetype),
TP_ARGS(preferred_zone, zone, order,
gfp_flags, alloc_flags, migratetype));
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */

View File

@@ -3839,6 +3839,8 @@ struct page *rmqueue(struct zone *preferred_zone,
__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
zone_statistics(preferred_zone, zone, 1);
trace_android_vh_rmqueue(preferred_zone, zone, order,
gfp_flags, alloc_flags, migratetype);
out:
/* Separate test+clear to avoid unnecessary atomics */