Skip to content

Commit

Permalink
SGI UV cpumask: use static temp cpumask in flush_tlb
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Travis authored and Ingo Molnar committed Jan 11, 2009
1 parent 4595f96 commit 0e21990
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions arch/x86/kernel/tlb_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,17 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
struct mm_struct *mm, unsigned long va)
{
if (is_uv_system()) {
cpumask_var_t after_uv_flush;

if (alloc_cpumask_var(&after_uv_flush, GFP_ATOMIC)) {
cpumask_andnot(after_uv_flush,
cpumask, cpumask_of(smp_processor_id()));
if (!uv_flush_tlb_others(after_uv_flush, mm, va))
flush_tlb_others_ipi(after_uv_flush, mm, va);
free_cpumask_var(after_uv_flush);
return;
}
/* FIXME: could be an percpu_alloc'd thing */
static DEFINE_PER_CPU(cpumask_t, flush_tlb_mask);
struct cpumask *after_uv_flush = &get_cpu_var(flush_tlb_mask);

cpumask_andnot(after_uv_flush, cpumask,
cpumask_of(smp_processor_id()));
if (!uv_flush_tlb_others(after_uv_flush, mm, va))
flush_tlb_others_ipi(after_uv_flush, mm, va);

put_cpu_var(flush_tlb_uv_cpumask);
return;
}
flush_tlb_others_ipi(cpumask, mm, va);
}
Expand Down

0 comments on commit 0e21990

Please sign in to comment.