mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 12:00:22 +09:00
ANDROID: mm: vh for compaction begin/end
Add vendor hook for compaction begin/end. The first use would be to measure compaction durations. Bug: 229927848 Test: local kernel build test Signed-off-by: Robin Hsu <robinhsu@google.com> Change-Id: I3d95434bf49b37199056dc9ddfc36a59a7de17b7
This commit is contained in:
@@ -214,6 +214,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_start);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pagecache_get_page);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_filemap_fault_get_page);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
struct cma;
|
||||
struct compact_control;
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
|
||||
TP_PROTO(gfp_t *flags),
|
||||
@@ -31,6 +32,12 @@ 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_mm_compaction_begin,
|
||||
TP_PROTO(struct compact_control *cc, long *vendor_ret),
|
||||
TP_ARGS(cc, vendor_ret));
|
||||
DECLARE_HOOK(android_vh_mm_compaction_end,
|
||||
TP_PROTO(struct compact_control *cc, long vendor_ret),
|
||||
TP_ARGS(cc, vendor_ret));
|
||||
DECLARE_HOOK(android_vh_rmqueue,
|
||||
TP_PROTO(struct zone *preferred_zone, struct zone *zone,
|
||||
unsigned int order, gfp_t gfp_flags,
|
||||
|
||||
@@ -44,6 +44,8 @@ static inline void count_compact_events(enum vm_event_item item, long delta)
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/compaction.h>
|
||||
#undef CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/mm.h>
|
||||
|
||||
#define block_start_pfn(pfn, order) round_down(pfn, 1UL << (order))
|
||||
#define block_end_pfn(pfn, order) ALIGN((pfn) + 1, 1UL << (order))
|
||||
@@ -2228,6 +2230,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
|
||||
unsigned long last_migrated_pfn;
|
||||
const bool sync = cc->mode != MIGRATE_ASYNC;
|
||||
bool update_cached;
|
||||
long vendor_ret;
|
||||
|
||||
/*
|
||||
* These counters track activities during zone compaction. Initialize
|
||||
@@ -2299,6 +2302,7 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
|
||||
|
||||
trace_mm_compaction_begin(start_pfn, cc->migrate_pfn,
|
||||
cc->free_pfn, end_pfn, sync);
|
||||
trace_android_vh_mm_compaction_begin(cc, &vendor_ret);
|
||||
|
||||
/* lru_add_drain_all could be expensive with involving other CPUs */
|
||||
lru_add_drain();
|
||||
@@ -2426,6 +2430,7 @@ out:
|
||||
count_compact_events(COMPACTMIGRATE_SCANNED, cc->total_migrate_scanned);
|
||||
count_compact_events(COMPACTFREE_SCANNED, cc->total_free_scanned);
|
||||
|
||||
trace_android_vh_mm_compaction_end(cc, vendor_ret);
|
||||
trace_mm_compaction_end(start_pfn, cc->migrate_pfn,
|
||||
cc->free_pfn, end_pfn, sync, ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user