Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1387691

[PATCH v2 3/5] x86/mm: Build arch/x86/mm/tlb.c even on !SMP

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v2 3/5] x86/mm: Build arch/x86/mm/tlb.c even on !SMP
Date 2016-04-26 18:40 +0200
Message-ID <rsebM-2ma-5@gated-at.bofh.it> (permalink)
References <rsebL-2ma-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Currently all of the functions that live in tlb.c are inlined on
!SMP builds.  One can debate whether this is a good idea (in many
respects the code in tlb.c is better than the inlined UP code).

Regardless, I want to add code that needs to be built on UP and SMP
kernels and relates to tlb flushing, so arrange for tlb.c to be
compiled unconditionally.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/mm/Makefile | 3 +--
 arch/x86/mm/tlb.c    | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index f98913258c63..62c0043a5fd5 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -2,7 +2,7 @@
 KCOV_INSTRUMENT_tlb.o	:= n
 
 obj-y	:=  init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
-	    pat.o pgtable.o physaddr.o gup.o setup_nx.o
+	    pat.o pgtable.o physaddr.o gup.o setup_nx.o tlb.o
 
 # Make sure __phys_addr has no stackprotector
 nostackp := $(call cc-option, -fno-stack-protector)
@@ -12,7 +12,6 @@ CFLAGS_setup_nx.o		:= $(nostackp)
 CFLAGS_fault.o := -I$(src)/../include/asm/trace
 
 obj-$(CONFIG_X86_PAT)		+= pat_rbtree.o
-obj-$(CONFIG_SMP)		+= tlb.o
 
 obj-$(CONFIG_X86_32)		+= pgtable_32.o iomap_32.o
 
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 8f4cc3dfac32..3f7a7939e65e 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -28,6 +28,8 @@
  *	Implement flush IPI by CALL_FUNCTION_VECTOR, Alex Shi
  */
 
+#ifdef CONFIG_SMP
+
 struct flush_tlb_info {
 	struct mm_struct *flush_mm;
 	unsigned long flush_start;
@@ -347,3 +349,5 @@ static int __init create_tlb_single_page_flush_ceiling(void)
 	return 0;
 }
 late_initcall(create_tlb_single_page_flush_ceiling);
+
+#endif /* CONFIG_SMP */
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] x86 switch_mm uninlining and IRQ improvements Andy Lutomirski <luto@kernel.org> - 2016-04-26 18:40 +0200
  [PATCH v2 3/5] x86/mm: Build arch/x86/mm/tlb.c even on !SMP Andy Lutomirski <luto@kernel.org> - 2016-04-26 18:40 +0200
  [PATCH v2 4/5] x86/mm: Uninline switch_mm Andy Lutomirski <luto@kernel.org> - 2016-04-26 18:40 +0200
  [PATCH v2 5/5] x86/mm: Turn off IRQs in switch_mm Andy Lutomirski <luto@kernel.org> - 2016-04-26 18:40 +0200
  [PATCH v2 1/5] arm: Include linux/preempt.h from asm/mmu_context.h Andy Lutomirski <luto@kernel.org> - 2016-04-26 18:40 +0200
  [PATCH v2 2/5] sched: Add switch_mm_irqs_off and use it in the scheduler Andy Lutomirski <luto@kernel.org> - 2016-04-26 18:50 +0200
  Re: [PATCH v2 0/5] x86 switch_mm uninlining and IRQ improvements Borislav Petkov <bp@alien8.de> - 2016-04-27 20:10 +0200

csiph-web