ANDROID: vendor hook for TLB batching control
Add vendor hook for flushing TLB batching in zap_pte_range. Merged CL 232bdcbd660b1129b7d8d0de25a563b476eeb522: ANDROID: pass argument in zap_pte_range vendor hooks Bug: 238728493 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: If2de5f070dd7b76624961f5a91440bf69a99ca2d Signed-off-by: Richard Chang <richardycc@google.com> (cherry picked from commit d257ef6764f228145d0fca24998162809bb5b9f7)
This commit is contained in:
committed by
Richard Chang
parent
bb6ab2be93
commit
243f54dd3a
@@ -279,3 +279,6 @@ 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);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pagevec_drain);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_zap_pte_range_tlb_start);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_zap_pte_range_tlb_force_flush);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_zap_pte_range_tlb_end);
|
||||
|
||||
@@ -80,6 +80,15 @@ DECLARE_HOOK(android_vh_mm_compaction_end,
|
||||
DECLARE_HOOK(android_vh_pagevec_drain,
|
||||
TP_PROTO(struct page *page, bool *ret),
|
||||
TP_ARGS(page, ret));
|
||||
DECLARE_HOOK(android_vh_zap_pte_range_tlb_start,
|
||||
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 *ret),
|
||||
TP_ARGS(ret));
|
||||
struct mem_cgroup;
|
||||
DECLARE_HOOK(android_vh_mem_cgroup_alloc,
|
||||
TP_PROTO(struct mem_cgroup *memcg),
|
||||
|
||||
@@ -1353,15 +1353,18 @@ 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(&v_ret);
|
||||
init_rss_vec(rss);
|
||||
start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
|
||||
pte = start_pte;
|
||||
flush_tlb_batched_pending(mm);
|
||||
arch_enter_lazy_mmu_mode();
|
||||
do {
|
||||
bool flush = false;
|
||||
pte_t ptent = *pte;
|
||||
if (pte_none(ptent))
|
||||
continue;
|
||||
@@ -1402,7 +1405,8 @@ again:
|
||||
page_remove_rmap(page, false);
|
||||
if (unlikely(page_mapcount(page) < 0))
|
||||
print_bad_pte(vma, addr, ptent, page);
|
||||
if (unlikely(__tlb_remove_page(tlb, page))) {
|
||||
trace_android_vh_zap_pte_range_tlb_force_flush(page, &flush);
|
||||
if (unlikely(__tlb_remove_page(tlb, page)) || flush) {
|
||||
force_flush = 1;
|
||||
addr += PAGE_SIZE;
|
||||
break;
|
||||
@@ -1474,6 +1478,7 @@ again:
|
||||
tlb_flush_mmu(tlb);
|
||||
}
|
||||
|
||||
trace_android_vh_zap_pte_range_tlb_end(&v_ret);
|
||||
if (addr != end) {
|
||||
cond_resched();
|
||||
goto again;
|
||||
|
||||
Reference in New Issue
Block a user