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
Signed-off-by: Chiawei Wang <chiaweiwang@google.com>
Change-Id: I89206727a462548cc3500b695d85c83ff003eec7
This commit is contained in:
Chiawei Wang
2021-02-18 10:43:50 +08:00
committed by Suren Baghdasaryan
parent ea15862d66
commit 369de37804
3 changed files with 11 additions and 0 deletions

View File

@@ -154,3 +154,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sp_pc_abort);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_setup_dma_ops);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue);

View File

@@ -9,6 +9,7 @@
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
@@ -21,6 +22,12 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_gfp_zone_flags,
DECLARE_RESTRICTED_HOOK(android_rvh_set_readahead_gfp_mask,
TP_PROTO(gfp_t *flags),
TP_ARGS(flags), 1);
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));
/* macro versions of hooks are no longer required */

View File

@@ -70,6 +70,7 @@
#include <linux/psi.h>
#include <linux/padata.h>
#include <linux/khugepaged.h>
#include <trace/hooks/mm.h>
#include <asm/sections.h>
#include <asm/tlbflush.h>
@@ -3528,6 +3529,8 @@ struct page *rmqueue(struct zone *preferred_zone,
__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
zone_statistics(preferred_zone, zone);
trace_android_vh_rmqueue(preferred_zone, zone, order,
gfp_flags, alloc_flags, migratetype);
local_irq_restore(flags);
out: