Skip to content

Commit

Permalink
x86: avoid re-loading LDT in unrelated address spaces
Browse files Browse the repository at this point in the history
Performance optimization.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Jan Beulich authored and Thomas Gleixner committed May 22, 2008
1 parent 78b58e5 commit b478458
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kernel/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include <asm/mmu_context.h>

#ifdef CONFIG_SMP
static void flush_ldt(void *null)
static void flush_ldt(void *current_mm)
{
if (current->active_mm)
if (current->active_mm == current_mm)
load_LDT(&current->active_mm->context);
}
#endif
Expand Down Expand Up @@ -68,7 +68,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
load_LDT(pc);
mask = cpumask_of_cpu(smp_processor_id());
if (!cpus_equal(current->mm->cpu_vm_mask, mask))
smp_call_function(flush_ldt, NULL, 1, 1);
smp_call_function(flush_ldt, current->mm, 1, 1);
preempt_enable();
#else
load_LDT(pc);
Expand Down

0 comments on commit b478458

Please sign in to comment.