ANDROID: pass argument in zap_pte_range vendor hooks

We need to carry on state from zap_pte_range_tlb_start to
zap_pte_range_tlb_end.

The new param on the function stack will keep the function
trace_android_vh_zap_pte_range_tlb_start called or not and
pass the state to trace_android_vh_zap_pte_range_tlb_end.

Thus, trace_android_vh_zap_pte_range_tlb_end will know
the trace_android_vh_zap_pte_range_tlb_start was called.
If it was called, trace_android_vh_zap_pte_range_tlb_end
will do action to make pair. Otherwise, just skip it.

Bug: 238728493
Bug: 256549265
Change-Id: I95706d51da66f916ede626686483523f3b68dacb
Signed-off-by: Minchan Kim <minchan@google.com>
This commit is contained in:
Minchan Kim
2022-11-01 09:07:47 -07:00
committed by Todd Kjos
parent a83ef907f0
commit 232bdcbd66
2 changed files with 7 additions and 6 deletions

View File

@@ -110,14 +110,14 @@ DECLARE_HOOK(android_vh_reclaim_pages_plug,
TP_PROTO(bool *do_plug),
TP_ARGS(do_plug));
DECLARE_HOOK(android_vh_zap_pte_range_tlb_start,
TP_PROTO(void *unused),
TP_ARGS(unused));
TP_PROTO(void *ret),
TP_ARGS(ret));
DECLARE_HOOK(android_vh_zap_pte_range_tlb_force_flush,
TP_PROTO(struct page *page, bool *flush),
TP_ARGS(page, flush));
DECLARE_HOOK(android_vh_zap_pte_range_tlb_end,
TP_PROTO(void *unused),
TP_ARGS(unused));
TP_PROTO(void *ret),
TP_ARGS(ret));
DECLARE_HOOK(android_vh_skip_lru_disable,
TP_PROTO(bool *skip),
TP_ARGS(skip));

View File

@@ -1230,10 +1230,11 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
pte_t *start_pte;
pte_t *pte;
swp_entry_t entry;
int v_ret = 0;
tlb_change_page_size(tlb, PAGE_SIZE);
again:
trace_android_vh_zap_pte_range_tlb_start(NULL);
trace_android_vh_zap_pte_range_tlb_start(&v_ret);
init_rss_vec(rss);
start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
pte = start_pte;
@@ -1349,7 +1350,7 @@ again:
tlb_flush_mmu(tlb);
}
trace_android_vh_zap_pte_range_tlb_end(NULL);
trace_android_vh_zap_pte_range_tlb_end(&v_ret);
if (addr != end) {
cond_resched();
goto again;