From: Jan Beulich Date: Mon, 12 May 2008 13:44:39 +0000 (+0200) Subject: x86: avoid re-loading LDT in unrelated address spaces X-Git-Tag: v2.6.27-rc1~1106^2~251^15 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b478458aeebfc55fe409abec43794ac72a623c79;p=linux-2.6-omap-h63xx.git x86: avoid re-loading LDT in unrelated address spaces Performance optimization. Signed-off-by: Jan Beulich Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 0224c3637c7..21f2bae98c1 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -20,9 +20,9 @@ #include #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);