From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yDCRT38lVzDrBX for ; Sat, 14 Oct 2017 03:12:37 +1100 (AEDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9DG6WYu036656 for ; Fri, 13 Oct 2017 12:12:35 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 2djym7u6na-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 13 Oct 2017 12:12:35 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Oct 2017 12:12:33 -0400 From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, mathieu.desnoyers@efficios.com, peterz@infradead.org, boqun.feng@gmail.com, ahh@google.com, maged.michael@gmail.com, gromer@google.com, avi@scylladb.com, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, davejwatson@fb.com, stern@rowland.harvard.edu, will.deacon@arm.com, luto@kernel.org, viro@zeniv.linux.org.uk, piggin@gmail.com, linux-arch@vger.kernel.org, "Paul E. McKenney" , Ingo Molnar , linuxppc-dev@lists.ozlabs.org Subject: [PATCH tip/sched/membarrier 4/5] membarrier: Remove unused code for architectures without membarrier hooks Date: Fri, 13 Oct 2017 09:12:24 -0700 In-Reply-To: <20171012170051.GA27468@linux.vnet.ibm.com> References: <20171012170051.GA27468@linux.vnet.ibm.com> Message-Id: <1507911145-4134-4-git-send-email-paulmck@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mathieu Desnoyers Architectures without membarrier hooks don't need to emit the empty membarrier_arch_switch_mm() static inline when CONFIG_MEMBARRIER=y. Adapt the CONFIG_MEMBARRIER=n counterpart to only emit the empty membarrier_arch_switch_mm() for architectures with membarrier hooks. Reported-by: Nicholas Piggin Signed-off-by: Mathieu Desnoyers CC: Peter Zijlstra CC: Paul E. McKenney CC: Boqun Feng CC: Andrew Hunter CC: Maged Michael CC: gromer@google.com CC: Avi Kivity CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Dave Watson CC: Alan Stern CC: Will Deacon CC: Andy Lutomirski CC: Ingo Molnar CC: Alexander Viro CC: linuxppc-dev@lists.ozlabs.org CC: linux-arch@vger.kernel.org Signed-off-by: Paul E. McKenney --- include/linux/sched/mm.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index e4955d293687..40379edac388 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -221,10 +221,6 @@ static inline void memalloc_noreclaim_restore(unsigned int flags) #ifdef CONFIG_ARCH_HAS_MEMBARRIER_HOOKS #include #else -static inline void membarrier_arch_switch_mm(struct mm_struct *prev, - struct mm_struct *next, struct task_struct *tsk) -{ -} static inline void membarrier_arch_fork(struct task_struct *t, unsigned long clone_flags) { @@ -253,10 +249,12 @@ static inline void membarrier_execve(struct task_struct *t) membarrier_arch_execve(t); } #else +#ifdef CONFIG_ARCH_HAS_MEMBARRIER_HOOKS static inline void membarrier_arch_switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { } +#endif static inline void membarrier_fork(struct task_struct *t, unsigned long clone_flags) { -- 2.5.2