From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014AbdJFVwP (ORCPT ); Fri, 6 Oct 2017 17:52:15 -0400 Received: from mail.efficios.com ([167.114.142.141]:42133 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbdJFVwM (ORCPT ); Fri, 6 Oct 2017 17:52:12 -0400 Date: Fri, 6 Oct 2017 21:53:33 +0000 (UTC) From: Mathieu Desnoyers To: "Paul E. McKenney" Cc: Peter Zijlstra , linux-kernel , Boqun Feng , Andrew Hunter , maged michael , gromer , Avi Kivity , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Dave Watson , Alan Stern , Will Deacon , Andy Lutomirski , Ingo Molnar , Alexander Viro , linuxppc-dev , linux-arch Message-ID: <285657409.33327.1507326813468.JavaMail.zimbra@efficios.com> In-Reply-To: <20171006210801.GL3521@linux.vnet.ibm.com> References: <20171005223327.3500-1-mathieu.desnoyers@efficios.com> <20171006210801.GL3521@linux.vnet.ibm.com> Subject: Re: [RFC PATCH for 4.14 1/2] membarrier: Remove unused code for architectures without membarrier hooks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.141] X-Mailer: Zimbra 8.7.11_GA_1854 (ZimbraWebClient - FF52 (Linux)/8.7.11_GA_1854) Thread-Topic: membarrier: Remove unused code for architectures without membarrier hooks Thread-Index: kQnfx5OqbUNaJUcNwVkilBc7Lyz9hQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Oct 6, 2017, at 5:08 PM, Paul E. McKenney paulmck@linux.vnet.ibm.com wrote: > On Thu, Oct 05, 2017 at 06:33:26PM -0400, Mathieu Desnoyers wrote: >> 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 > > Queued for further review and testing, targeting v4.15. Please let me > know if you need it sooner. Hi Paul, Given that the following patch in this patchset (2/2) "Fix: membarrier: Handle CLONE_VM + !CLONE_THREAD correctly on powerpc" is based on this patch, and that the fix needs to go into 4.14, I would recommend queuing both patches for 4.14 is possible. Otherwise I could try swapping the order of the two patches if needed, but since both are touching nearby code areas, rebasing is not straightforward. Thanks, Mathieu > > Thanx, Paul > >> 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) >> { >> -- >> 2.11.0 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com