All of lore.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <waiman.long@hp.com>
To: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	Rik van Riel <riel@redhat.com>,
	Peter Hurley <peter@hurleysoftware.com>,
	Davidlohr Bueso <davidlohr.bueso@hp.com>,
	Alex Shi <alex.shi@linaro.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Matthew R Wilcox <matthew.r.wilcox@intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Michel Lespinasse <walken@google.com>,
	Andi Kleen <andi@firstfloor.org>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	George Spelvin <linux@horizon.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
	Aswin Chandramouleeswaran <aswin@hp.com>,
	Scott J Norton <scott.norton@h>
Subject: Re: [PATCH v8 10/10] MCS Lock: Make mcs_spinlock.h includable in other files
Date: Thu, 24 Oct 2013 19:20:39 -0400	[thread overview]
Message-ID: <5269AB47.4000007@hp.com> (raw)
In-Reply-To: <1382648315.11046.224.camel@schen9-DESK>

On 10/24/2013 04:58 PM, Tim Chen wrote:
>
> Do we want to inline the unlock?  Will that prevent proper profile
> accounting of unlock overhead?
>
> Can we keep the mcs_spin_unlock and mcs_spin_lock in the same
> kernel/mcs_spinlock.c file? That makes it easier to read and
> maintain the code.

The unlock code is fast. The lock code, however, can run for a long 
time. It will greatly increase the reported time spent in the calling 
function if it is inlined. The same is true for spinlock. The 
_raw_spin_lock() is a real function while _raw_spin_unlock() is inlined 
in most cases.

Yes, I can bring the lock function back to the mcs_spinlock.h file with 
name like _raw_mcs_spin_lock() and the mcs_spin_lock() in mcs_spinlock.c 
will include the raw function. In that way, the mcs_spin_lock() will 
still be a separate function while both the lock and unlock code will be 
together.

> Can you check if you have applied all the previous MCS patches?
> The last two for barrier corrections and optimizations seem
> to be missing.
>
> MCS Lock: optimizations and extra comments
> https://lkml.org/lkml/2013/10/2/644
> MCS Lock: Barrier corrections
> https://lkml.org/lkml/2013/10/2/650
>
> Thanks.
>
> Tim
>

Apparently, I does have all the MCS patch  in my git tree. I will 
regenerate a new one with the right diff. Thank for the review.

-Longman

WARNING: multiple messages have this Message-ID (diff)
From: Waiman Long <waiman.long@hp.com>
To: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	Rik van Riel <riel@redhat.com>,
	Peter Hurley <peter@hurleysoftware.com>,
	Davidlohr Bueso <davidlohr.bueso@hp.com>,
	Alex Shi <alex.shi@linaro.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Matthew R Wilcox <matthew.r.wilcox@intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Michel Lespinasse <walken@google.com>,
	Andi Kleen <andi@firstfloor.org>,
	Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	George Spelvin <linux@horizon.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
	Aswin Chandramouleeswaran <aswin@hp.com>,
	Scott J Norton <scott.norton@hp.com>,
	Davidlohr Bueso <davidlohr@hp.com>, Jason Low <jason.low2@hp.com>
Subject: Re: [PATCH v8 10/10] MCS Lock: Make mcs_spinlock.h includable in other files
Date: Thu, 24 Oct 2013 19:20:39 -0400	[thread overview]
Message-ID: <5269AB47.4000007@hp.com> (raw)
Message-ID: <20131024232039.rmfYVhAJdVCMXjW8adf6q4a6pZ54tCcgzntB-g_B4zQ@z> (raw)
In-Reply-To: <1382648315.11046.224.camel@schen9-DESK>

On 10/24/2013 04:58 PM, Tim Chen wrote:
>
> Do we want to inline the unlock?  Will that prevent proper profile
> accounting of unlock overhead?
>
> Can we keep the mcs_spin_unlock and mcs_spin_lock in the same
> kernel/mcs_spinlock.c file? That makes it easier to read and
> maintain the code.

The unlock code is fast. The lock code, however, can run for a long 
time. It will greatly increase the reported time spent in the calling 
function if it is inlined. The same is true for spinlock. The 
_raw_spin_lock() is a real function while _raw_spin_unlock() is inlined 
in most cases.

Yes, I can bring the lock function back to the mcs_spinlock.h file with 
name like _raw_mcs_spin_lock() and the mcs_spin_lock() in mcs_spinlock.c 
will include the raw function. In that way, the mcs_spin_lock() will 
still be a separate function while both the lock and unlock code will be 
together.

> Can you check if you have applied all the previous MCS patches?
> The last two for barrier corrections and optimizations seem
> to be missing.
>
> MCS Lock: optimizations and extra comments
> https://lkml.org/lkml/2013/10/2/644
> MCS Lock: Barrier corrections
> https://lkml.org/lkml/2013/10/2/650
>
> Thanks.
>
> Tim
>

Apparently, I does have all the MCS patch  in my git tree. I will 
regenerate a new one with the right diff. Thank for the review.

-Longman

  reply	other threads:[~2013-10-24 23:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 20:01 [PATCH v8 10/10] MCS Lock: Make mcs_spinlock.h includable in other files Waiman Long
2013-10-24 20:01 ` Waiman Long
2013-10-24 20:58 ` Tim Chen
2013-10-24 20:58   ` Tim Chen
2013-10-24 23:20   ` Waiman Long [this message]
2013-10-24 23:20     ` Waiman Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5269AB47.4000007@hp.com \
    --to=waiman.long@hp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@linaro.org \
    --cc=andi@firstfloor.org \
    --cc=arnd@arndb.de \
    --cc=aswin@hp.com \
    --cc=dave.hansen@intel.com \
    --cc=davidlohr.bueso@hp.com \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=matthew.r.wilcox@intel.com \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peter@hurleysoftware.com \
    --cc=raghavendra.kt@linux.vnet.ibm.com \
    --cc=riel@redhat.com \
    --cc=scott.norton@h \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=walken@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.