mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
ANDROID: vendor hook for TLB batching control
Add vendor hook for flushing TLB batching in zap_pte_range. Bug: 238728493 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: If2de5f070dd7b76624961f5a91440bf69a99ca2d
This commit is contained in:
@@ -282,6 +282,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_get_from_fragment_pool);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exclude_reserved_zone);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_include_reserved_zone);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_slowpath);
|
||||
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);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cma_alloc_adjust);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_mem);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_print_slabinfo_header);
|
||||
|
||||
@@ -100,6 +100,15 @@ DECLARE_HOOK(android_vh_alloc_pages_slowpath,
|
||||
DECLARE_HOOK(android_vh_cma_alloc_adjust,
|
||||
TP_PROTO(struct zone *zone, bool *is_cma_alloc),
|
||||
TP_ARGS(zone, is_cma_alloc));
|
||||
DECLARE_HOOK(android_vh_zap_pte_range_tlb_start,
|
||||
TP_PROTO(void *unused),
|
||||
TP_ARGS(unused));
|
||||
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));
|
||||
DECLARE_HOOK(android_vh_print_slabinfo_header,
|
||||
TP_PROTO(struct seq_file *m),
|
||||
TP_ARGS(m));
|
||||
|
||||
@@ -1233,12 +1233,14 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
|
||||
|
||||
tlb_change_page_size(tlb, PAGE_SIZE);
|
||||
again:
|
||||
trace_android_vh_zap_pte_range_tlb_start(NULL);
|
||||
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;
|
||||
@@ -1279,8 +1281,9 @@ again:
|
||||
page_remove_rmap(page, false);
|
||||
if (unlikely(page_mapcount(page) < 0))
|
||||
print_bad_pte(vma, addr, ptent, page);
|
||||
trace_android_vh_zap_pte_range_tlb_force_flush(page, &flush);
|
||||
if (unlikely(__tlb_remove_page(tlb, page)) ||
|
||||
lru_cache_disabled()) {
|
||||
lru_cache_disabled() || flush) {
|
||||
force_flush = 1;
|
||||
addr += PAGE_SIZE;
|
||||
break;
|
||||
@@ -1346,6 +1349,7 @@ again:
|
||||
tlb_flush_mmu(tlb);
|
||||
}
|
||||
|
||||
trace_android_vh_zap_pte_range_tlb_end(NULL);
|
||||
if (addr != end) {
|
||||
cond_resched();
|
||||
goto again;
|
||||
|
||||
Reference in New Issue
Block a user