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

Commit 02cf94c3 authored by Tejun Heo's avatar Tejun Heo
Browse files

x86: make x86_32 use tlb_64.c



Impact: less contention when issuing invalidate IPI, cleanup

Make x86_32 use the same tlb code as 64bit.  The 64bit code uses
multiple IPI vectors for tlb shootdown to reduce contention.  This
patch makes x86_32 allocate the same 8 IPIs as x86_64 and share the
code paths.

Note that the usage of asmlinkage is inconsistent for x86_32 and 64
and calls for further cleanup.  This has been noted with a FIXME
comment in tlb_64.c.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 6dd01bed
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -58,8 +58,11 @@
# define CALL_FUNCTION_VECTOR		0xfc
# define CALL_FUNCTION_SINGLE_VECTOR	0xfb
# define THERMAL_APIC_VECTOR		0xfa
/* 0xf1 - 0xf9 : free */
# define INVALIDATE_TLB_VECTOR		0xf0
/* 0xf8 - 0xf9 : free */
# define INVALIDATE_TLB_VECTOR_END	0xf7
# define INVALIDATE_TLB_VECTOR_START	0xf0	/* f0-f7 used for TLB flush */

# define NUM_INVALIDATE_TLB_VECTORS	8

#else

+17 −1
Original line number Diff line number Diff line
@@ -11,10 +11,26 @@
 */
#ifdef CONFIG_X86_SMP
BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR)
BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)

BUILD_INTERRUPT3(invalidate_interrupt0,INVALIDATE_TLB_VECTOR_START+0,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt1,INVALIDATE_TLB_VECTOR_START+1,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt2,INVALIDATE_TLB_VECTOR_START+2,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt3,INVALIDATE_TLB_VECTOR_START+3,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt4,INVALIDATE_TLB_VECTOR_START+4,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt5,INVALIDATE_TLB_VECTOR_START+5,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt6,INVALIDATE_TLB_VECTOR_START+6,
		 smp_invalidate_interrupt)
BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
		 smp_invalidate_interrupt)
#endif

/*
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ obj-$(CONFIG_PCI) += early-quirks.o
apm-y				:= apm_32.o
obj-$(CONFIG_APM)		+= apm.o
obj-$(CONFIG_X86_SMP)		+= smp.o
obj-$(CONFIG_X86_SMP)		+= smpboot.o tsc_sync.o ipi.o tlb_$(BITS).o
obj-$(CONFIG_X86_SMP)		+= smpboot.o tsc_sync.o ipi.o tlb_64.o
obj-$(CONFIG_X86_32_SMP)	+= smpcommon.o
obj-$(CONFIG_X86_64_SMP)	+= tsc_sync.o smpcommon.o
obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline_$(BITS).o
+4 −2
Original line number Diff line number Diff line
@@ -672,7 +672,7 @@ common_interrupt:
ENDPROC(common_interrupt)
	CFI_ENDPROC

#define BUILD_INTERRUPT(name, nr)	\
#define BUILD_INTERRUPT3(name, nr, fn)	\
ENTRY(name)				\
	RING0_INT_FRAME;		\
	pushl $~(nr);			\
@@ -680,11 +680,13 @@ ENTRY(name) \
	SAVE_ALL;			\
	TRACE_IRQS_OFF			\
	movl %esp,%eax;			\
	call smp_##name;		\
	call fn;			\
	jmp ret_from_intr;		\
	CFI_ENDPROC;			\
ENDPROC(name)

#define BUILD_INTERRUPT(name, nr)	BUILD_INTERRUPT3(name, nr, smp_##name)

/* The include is where all of the SMP etc. interrupts come from */
#include "entry_arch.h"

+9 −2
Original line number Diff line number Diff line
@@ -149,8 +149,15 @@ void __init native_init_IRQ(void)
	 */
	alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt);

	/* IPI for invalidation */
	alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
	/* IPIs for invalidation */
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+0, invalidate_interrupt0);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+1, invalidate_interrupt1);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+2, invalidate_interrupt2);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+3, invalidate_interrupt3);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+4, invalidate_interrupt4);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+5, invalidate_interrupt5);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+6, invalidate_interrupt6);
	alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+7, invalidate_interrupt7);

	/* IPI for generic function call */
	alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
Loading