From patchwork Thu Oct 5 22:33:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 822127 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y7SLM5SBfz9t2h for ; Fri, 6 Oct 2017 09:36:43 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3y7SLM3ynSzDqhg for ; Fri, 6 Oct 2017 09:36:43 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=efficios.com (client-ip=167.114.142.141; helo=mail.efficios.com; envelope-from=mathieu.desnoyers@efficios.com; receiver=) Received: from mail.efficios.com (mail.efficios.com [167.114.142.141]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3y7SH0426tzDqhb for ; Fri, 6 Oct 2017 09:33:48 +1100 (AEDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id DBCF23402AD; Thu, 5 Oct 2017 22:35:18 +0000 (UTC) Received: from mail.efficios.com ([127.0.0.1]) by localhost (evm-mail-1.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FwhOsNcLD_3W; Thu, 5 Oct 2017 22:35:04 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id AC31734028D; Thu, 5 Oct 2017 22:35:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (evm-mail-1.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uK5-JgAHvmK3; Thu, 5 Oct 2017 22:35:04 +0000 (UTC) Received: from thinkos.internal.efficios.com (cable-192.222.218.157.electronicbox.net [192.222.218.157]) by mail.efficios.com (Postfix) with ESMTPSA id 5CC92340179; Thu, 5 Oct 2017 22:35:04 +0000 (UTC) From: Mathieu Desnoyers To: "Paul E . McKenney" , Peter Zijlstra Subject: [RFC PATCH for 4.14 1/2] membarrier: Remove unused code for architectures without membarrier hooks Date: Thu, 5 Oct 2017 18:33:26 -0400 Message-Id: <20171005223327.3500-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Avi Kivity , Maged Michael , Boqun Feng , Dave Watson , Alan Stern , linux-kernel@vger.kernel.org, Will Deacon , Andrew Hunter , Ingo Molnar , Mathieu Desnoyers , Alexander Viro , Andy Lutomirski , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, gromer@google.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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 d5a9ab8f3836..b2767ecb21a8 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -215,10 +215,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) { @@ -247,10 +243,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) {