aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tlb_64.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2009-01-11 00:58:10 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-11 13:13:09 -0500
commit0e21990ae7ee11af94f44f240b06e520cf1505d4 (patch)
tree759edecf00072c61f0640f317d736b1eccd53f19 /arch/x86/kernel/tlb_64.c
parent4595f9620cda8a1e973588e743cf5f8436dd20c6 (diff)
SGI UV cpumask: use static temp cpumask in flush_tlb
Impact: Improve tlb flush performance for UV Calling alloc_cpumask_var a zillion times a second does affect performance. Replace with static cpumask. Note: when CONFIG_X86_UV is defined, this extra PER_CPU memory will be optimized out for non-UV configs as is_uv_system() will then return a constant 0. Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'arch/x86/kernel/tlb_64.c')
-rw-r--r--arch/x86/kernel/tlb_64.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/kernel/tlb_64.c
index 38836aef51b4..7a3f9891302d 100644
--- a/arch/x86/kernel/tlb_64.c
+++ b/arch/x86/kernel/tlb_64.c
@@ -202,16 +202,17 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
202 struct mm_struct *mm, unsigned long va) 202 struct mm_struct *mm, unsigned long va)
203{ 203{
204 if (is_uv_system()) { 204 if (is_uv_system()) {
205 cpumask_var_t after_uv_flush; 205 /* FIXME: could be an percpu_alloc'd thing */
206 206 static DEFINE_PER_CPU(cpumask_t, flush_tlb_mask);
207 if (alloc_cpumask_var(&after_uv_flush, GFP_ATOMIC)) { 207 struct cpumask *after_uv_flush = &get_cpu_var(flush_tlb_mask);
208 cpumask_andnot(after_uv_flush, 208
209 cpumask, cpumask_of(smp_processor_id())); 209 cpumask_andnot(after_uv_flush, cpumask,
210 if (!uv_flush_tlb_others(after_uv_flush, mm, va)) 210 cpumask_of(smp_processor_id()));
211 flush_tlb_others_ipi(after_uv_flush, mm, va); 211 if (!uv_flush_tlb_others(after_uv_flush, mm, va))
212 free_cpumask_var(after_uv_flush); 212 flush_tlb_others_ipi(after_uv_flush, mm, va);
213 return; 213
214 } 214 put_cpu_var(flush_tlb_uv_cpumask);
215 return;
215 } 216 }
216 flush_tlb_others_ipi(cpumask, mm, va); 217 flush_tlb_others_ipi(cpumask, mm, va);
217} 218}