diff options
author | Jan Beulich <jbeulich@novell.com> | 2008-05-12 17:44:39 +0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-22 21:11:20 +0400 |
commit | b478458aeebfc55fe409abec43794ac72a623c79 (patch) | |
tree | 8a007777d874172de964c4e724f968fa0ae8d301 /arch/x86/kernel/ldt.c | |
parent | 78b58e549a3098a8c1408d0214bd25e5d5e7a3a3 (diff) | |
download | linux-b478458aeebfc55fe409abec43794ac72a623c79.tar.xz |
x86: avoid re-loading LDT in unrelated address spaces
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>
Diffstat (limited to 'arch/x86/kernel/ldt.c')
-rw-r--r-- | arch/x86/kernel/ldt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 0224c3637c73..21f2bae98c15 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -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(¤t->active_mm->context); } #endif @@ -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); |