ANDROID: GKI: add vendor hooks for swapping in ahead

Add vendor hooks to capture demand paging during APP launch,
so we can do it in advance in next launch.

Bug: 315913896
Signed-off-by: Lianjun Huang <huanglianjun@xiaomi.com>
Signed-off-by: Lianjun Huang <huanglianjun@xiaomi.corp-partner.google.com>
Change-Id: I2698fefd347745fb4ff84b111caedbb3bb365ce3
This commit is contained in:
Lianjun Huang 2023-12-12 15:51:36 +08:00 committed by Suren Baghdasaryan
parent fd40c1d901
commit d4db0d5d08
3 changed files with 5 additions and 0 deletions

View file

@ -312,6 +312,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_unregister);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_thermal_zone_device);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_thermal_power_cap);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_enable_thermal_power_throttle);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_read_pages);
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_madvise_pageout_swap_entry);

View file

@ -76,6 +76,9 @@ struct slabinfo;
DECLARE_HOOK(android_vh_cache_show,
TP_PROTO(struct seq_file *m, struct slabinfo *sinfo, struct kmem_cache *s),
TP_ARGS(m, sinfo, s));
DECLARE_HOOK(android_vh_read_pages,
TP_PROTO(struct readahead_control *ractl),
TP_ARGS(ractl));
DECLARE_HOOK(android_vh_alloc_pages_reclaim_bypass,
TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags,
int migratetype, struct page **page),

View file

@ -167,6 +167,7 @@ static void read_pages(struct readahead_control *rac)
psi_memstall_enter(&rac->_pflags);
blk_start_plug(&plug);
trace_android_vh_read_pages(rac);
if (aops->readahead) {
aops->readahead(rac);
/*