diff options
author | Will Deacon <will.deacon@arm.com> | 2013-02-11 08:47:48 -0500 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-08-12 07:25:44 -0400 |
commit | f0915781bd5edf78b1154e61efe962dc15872d09 (patch) | |
tree | a8dc2c7b3c4f0f437171a80c6bde06b020418dc3 /arch/arm/mm | |
parent | 792a843a9f353d3e2474b6f5057b7eaecba41675 (diff) |
ARM: tlb: don't perform inner-shareable invalidation for local TLB ops
Inner-shareable TLB invalidation is typically more expensive than local
(non-shareable) invalidation, so performing the broadcasting for
local_flush_tlb_* operations is a waste of cycles and needlessly
clobbers entries in the TLBs of other CPUs.
This patch introduces __flush_tlb_* versions for many of the TLB
invalidation functions, which only respect inner-shareable variants of
the invalidation instructions when presented with the TLB_V7_UIS_FULL
flag. The local version is also inlined to prevent SMP_ON_UP kernels
from missing flushes, where the __flush variant would be called with
the UP flags.
This gains us around 0.5% in hackbench scores for a dual-core A15, but I
would expect this to improve as more cores (and clusters) are added to
the equation.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Albin Tonnerre <Albin.Tonnerre@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/context.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index 4a0544492f10..84e6f772e204 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -162,10 +162,7 @@ static void flush_context(unsigned int cpu) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | /* Queue a TLB invalidate and flush the I-cache if necessary. */ | 164 | /* Queue a TLB invalidate and flush the I-cache if necessary. */ |
165 | if (!tlb_ops_need_broadcast()) | 165 | cpumask_setall(&tlb_flush_pending); |
166 | cpumask_set_cpu(cpu, &tlb_flush_pending); | ||
167 | else | ||
168 | cpumask_setall(&tlb_flush_pending); | ||
169 | 166 | ||
170 | if (icache_is_vivt_asid_tagged()) | 167 | if (icache_is_vivt_asid_tagged()) |
171 | __flush_icache_all(); | 168 | __flush_icache_all(); |
@@ -245,8 +242,6 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) | |||
245 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { | 242 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { |
246 | local_flush_bp_all(); | 243 | local_flush_bp_all(); |
247 | local_flush_tlb_all(); | 244 | local_flush_tlb_all(); |
248 | if (erratum_a15_798181()) | ||
249 | dummy_flush_tlb_a15_erratum(); | ||
250 | } | 245 | } |
251 | 246 | ||
252 | atomic64_set(&per_cpu(active_asids, cpu), asid); | 247 | atomic64_set(&per_cpu(active_asids, cpu), asid); |