From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbaATMQa (ORCPT ); Mon, 20 Jan 2014 07:16:30 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54925 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751832AbaATMQ2 (ORCPT ); Mon, 20 Jan 2014 07:16:28 -0500 Date: Mon, 20 Jan 2014 13:15:47 +0100 From: Peter Zijlstra To: Tim Chen Cc: Ingo Molnar , Andrew Morton , Thomas Gleixner , "Paul E.McKenney" , Will Deacon , linux-kernel@vger.kernel.org, linux-mm , linux-arch@vger.kernel.org, Linus Torvalds , Waiman Long , Andrea Arcangeli , Alex Shi , Andi Kleen , Michel Lespinasse , Davidlohr Bueso , Matthew R Wilcox , Dave Hansen , Rik van Riel , Peter Hurley , Raghavendra K T , George Spelvin , "H. Peter Anvin" , Arnd Bergmann , Aswin Chandramouleeswaran , Scott J Norton , "Figo.zhang" Subject: Re: [PATCH v7 3/6] MCS Lock: Move mcs_lock/unlock function into its own file Message-ID: <20140120121547.GC31570@twins.programming.kicks-ass.net> References: <1389917304.3138.13.camel@schen9-DESK> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1389917304.3138.13.camel@schen9-DESK> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2014 at 04:08:24PM -0800, Tim Chen wrote: > copy to kernel/locking/mcs_spinlock.c > index 96f14299..44fb092 100644 > --- a/include/linux/mcs_spinlock.h > +++ b/kernel/locking/mcs_spinlock.c > +/* > + * asm/processor.h may define arch_mutex_cpu_relax(). > + * If it is not defined, cpu_relax() will be used. > + */ > +#include > +#include > +#include > +#include > +#include > +#include > > +#ifndef arch_mutex_cpu_relax > +# define arch_mutex_cpu_relax() cpu_relax() > +#endif Why not include to obtain arch_mutex_cpu_relax() ? Now you have duplicated the definition, and in a file unrelated to its name 'mutex'. Now, arguable, we should maybe look at renaming the thing now that its used outside of mutices, but whatever we do, I think its sane to keep a single 'generic' definition.