From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754646Ab3KFPcK (ORCPT ); Wed, 6 Nov 2013 10:32:10 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:27635 "EHLO g4t0016.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754443Ab3KFPcI (ORCPT ); Wed, 6 Nov 2013 10:32:08 -0500 Message-ID: <527A60E3.3000106@hp.com> Date: Wed, 06 Nov 2013 10:31:47 -0500 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Tim Chen CC: Peter Zijlstra , Ingo Molnar , Andrew Morton , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-mm , linux-arch@vger.kernel.org, Linus Torvalds , Andrea Arcangeli , Alex Shi , Andi Kleen , Michel Lespinasse , Davidlohr Bueso , Matthew R Wilcox , Dave Hansen , Rik van Riel , Peter Hurley , "Paul E.McKenney" , Raghavendra K T , George Spelvin , "H. Peter Anvin" , Arnd Bergmann , Aswin Chandramouleeswaran , Scott J Norton , Will Deacon Subject: Re: [PATCH v2 4/4] MCS Lock: Make mcs_spinlock.h includable in other files References: <1383673359.11046.280.camel@schen9-DESK> <20131105185717.GZ16117@laptop.programming.kicks-ass.net> <1383679842.11046.298.camel@schen9-DESK> In-Reply-To: <1383679842.11046.298.camel@schen9-DESK> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/05/2013 02:30 PM, Tim Chen wrote: > On Tue, 2013-11-05 at 19:57 +0100, Peter Zijlstra wrote: >> On Tue, Nov 05, 2013 at 09:42:39AM -0800, Tim Chen wrote: >>> + * The _raw_mcs_spin_lock() function should not be called directly. Instead, >>> + * users should call mcs_spin_lock(). >>> */ >>> -static noinline >>> -void mcs_spin_lock(struct mcs_spinlock **lock, struct mcs_spinlock *node) >>> +static inline >>> +void _raw_mcs_spin_lock(struct mcs_spinlock **lock, struct mcs_spinlock *node) >>> { >>> struct mcs_spinlock *prev; >>> >> So why keep it in the header at all? > I also made the suggestion originally of keeping both lock and unlock in > mcs_spinlock.c. Wonder if Waiman decides to keep them in header > because in-lining the unlock function makes execution a bit faster? > > Tim > I was following the example of the spinlock code where the lock function is not inlined, but the unlock function is. I have no objection to make them both as non-inlined functions, if you think that is the right move. Regards, Longman