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_begin);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
|
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_compaction_end);
|
||||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pagevec_drain);
|
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,
|
DECLARE_HOOK(android_vh_pagevec_drain,
|
||||||
TP_PROTO(struct page *page, bool *ret),
|
TP_PROTO(struct page *page, bool *ret),
|
||||||
TP_ARGS(page, 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;
|
struct mem_cgroup;
|
||||||
DECLARE_HOOK(android_vh_mem_cgroup_alloc,
|
DECLARE_HOOK(android_vh_mem_cgroup_alloc,
|
||||||
TP_PROTO(struct mem_cgroup *memcg),
|
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 *start_pte;
|
||||||
pte_t *pte;
|
pte_t *pte;
|
||||||
swp_entry_t entry;
|
swp_entry_t entry;
|
||||||
|
int v_ret = 0;
|
||||||
|
|
||||||
tlb_change_page_size(tlb, PAGE_SIZE);
|
tlb_change_page_size(tlb, PAGE_SIZE);
|
||||||
again:
|
again:
|
||||||
|
trace_android_vh_zap_pte_range_tlb_start(&v_ret);
|
||||||
init_rss_vec(rss);
|
init_rss_vec(rss);
|
||||||
start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
|
start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
|
||||||
pte = start_pte;
|
pte = start_pte;
|
||||||
flush_tlb_batched_pending(mm);
|
flush_tlb_batched_pending(mm);
|
||||||
arch_enter_lazy_mmu_mode();
|
arch_enter_lazy_mmu_mode();
|
||||||
do {
|
do {
|
||||||
|
bool flush = false;
|
||||||
pte_t ptent = *pte;
|
pte_t ptent = *pte;
|
||||||
if (pte_none(ptent))
|
if (pte_none(ptent))
|
||||||
continue;
|
continue;
|
||||||
@@ -1402,7 +1405,8 @@ again:
|
|||||||
page_remove_rmap(page, false);
|
page_remove_rmap(page, false);
|
||||||
if (unlikely(page_mapcount(page) < 0))
|
if (unlikely(page_mapcount(page) < 0))
|
||||||
print_bad_pte(vma, addr, ptent, page);
|
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;
|
force_flush = 1;
|
||||||
addr += PAGE_SIZE;
|
addr += PAGE_SIZE;
|
||||||
break;
|
break;
|
||||||
@@ -1474,6 +1478,7 @@ again:
|
|||||||
tlb_flush_mmu(tlb);
|
tlb_flush_mmu(tlb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace_android_vh_zap_pte_range_tlb_end(&v_ret);
|
||||||
if (addr != end) {
|
if (addr != end) {
|
||||||
cond_resched();
|
cond_resched();
|
||||||
goto again;
|
goto again;
|
||||||
|
|||||||
Reference in New Issue
Block a user