mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +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
Signed-off-by: Richard Chang <richardycc@google.com>
(cherry picked from commit 13b6bd38bb)
This commit is contained in:
@@ -276,3 +276,5 @@ 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_enable_thermal_genl_check);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_begin);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
struct oom_control;
|
||||
struct slabinfo;
|
||||
struct cma;
|
||||
struct compact_control;
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
|
||||
TP_PROTO(gfp_t *flags),
|
||||
@@ -70,6 +71,12 @@ DECLARE_HOOK(android_vh_mmap_region,
|
||||
DECLARE_HOOK(android_vh_try_to_unmap_one,
|
||||
TP_PROTO(struct vm_area_struct *vma, struct page *page, unsigned long addr, bool ret),
|
||||
TP_ARGS(vma, page, addr, ret));
|
||||
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));
|
||||
struct mem_cgroup;
|
||||
DECLARE_HOOK(android_vh_mem_cgroup_alloc,
|
||||
TP_PROTO(struct mem_cgroup *memcg),
|
||||
|
||||
@@ -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))
|
||||
@@ -2338,6 +2340,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
|
||||
@@ -2409,6 +2412,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();
|
||||
@@ -2535,6 +2539,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