Commit 96e4d6a5 authored by Oliver Upton's avatar Oliver Upton Committed by Kefeng Wang
Browse files

arm64: tlbflush: Rename MAX_TLBI_OPS

mainline inclusion
from mainline-v6.7-rc1
commit ec1c3b9ff16082f880b304be40992568f4eee6a7
category: performance
bugzilla: https://gitee.com/openeuler/kernel/issues/IB82FR


CVE: NA

-------------------------------------------------

Perhaps unsurprisingly, I-cache invalidations suffer from performance
issues similar to TLB invalidations on certain systems. TLB and I-cache
maintenance all result in DVM on the mesh, which is where the real
bottleneck lies.

Rename the heuristic to point the finger at DVM, such that it may be
reused for limiting I-cache invalidations.

Reviewed-by: default avatarGavin Shan <gshan@redhat.com>
Tested-by: default avatarGavin Shan <gshan@redhat.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20230920080133.944717-2-oliver.upton@linux.dev


Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
(cherry picked from commit ec1c3b9ff16082f880b304be40992568f4eee6a7)
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
parent 151d80c0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ static inline void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch)
 * This is meant to avoid soft lock-ups on large TLB flushing ranges and not
 * necessarily a performance improvement.
 */
#define MAX_TLBI_OPS	PTRS_PER_PTE
#define MAX_DVM_OPS	PTRS_PER_PTE

/*
 * __flush_tlb_range_op - Perform TLBI operation upon a range
@@ -415,12 +415,12 @@ static inline void __flush_tlb_range_nosync(struct vm_area_struct *vma,

	/*
	 * When not uses TLB range ops, we can handle up to
	 * (MAX_TLBI_OPS - 1) pages;
	 * (MAX_DVM_OPS - 1) pages;
	 * When uses TLB range ops, we can handle up to
	 * (MAX_TLBI_RANGE_PAGES - 1) pages.
	 */
	if ((!system_supports_tlb_range() &&
	     (end - start) >= (MAX_TLBI_OPS * stride)) ||
	     (end - start) >= (MAX_DVM_OPS * stride)) ||
	    pages >= MAX_TLBI_RANGE_PAGES) {
		flush_tlb_mm(vma->vm_mm);
		return;
@@ -462,7 +462,7 @@ static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end
{
	unsigned long addr;

	if ((end - start) > (MAX_TLBI_OPS * PAGE_SIZE)) {
	if ((end - start) > (MAX_DVM_OPS * PAGE_SIZE)) {
		flush_tlb_all();
		return;
	}