Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b478458a authored by Jan Beulich's avatar Jan Beulich Committed by Thomas Gleixner
Browse files

x86: avoid re-loading LDT in unrelated address spaces



Performance optimization.

Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 78b58e54
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -20,9 +20,9 @@
#include <asm/mmu_context.h>
#include <asm/mmu_context.h>


#ifdef CONFIG_SMP
#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);
		load_LDT(&current->active_mm->context);
}
}
#endif
#endif
@@ -68,7 +68,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
		load_LDT(pc);
		load_LDT(pc);
		mask = cpumask_of_cpu(smp_processor_id());
		mask = cpumask_of_cpu(smp_processor_id());
		if (!cpus_equal(current->mm->cpu_vm_mask, mask))
		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();
		preempt_enable();
#else
#else
		load_LDT(pc);
		load_LDT(pc);