[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1384901861.11046.449.camel@schen9-DESK>
Date: Tue, 19 Nov 2013 14:57:41 -0800
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: paulmck@...ux.vnet.ibm.com
Cc: Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, linux-mm <linux-mm@...ck.org>,
linux-arch@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Waiman Long <waiman.long@...com>,
Andrea Arcangeli <aarcange@...hat.com>,
Alex Shi <alex.shi@...aro.org>,
Andi Kleen <andi@...stfloor.org>,
Michel Lespinasse <walken@...gle.com>,
Davidlohr Bueso <davidlohr.bueso@...com>,
Matthew R Wilcox <matthew.r.wilcox@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Rik van Riel <riel@...hat.com>,
Peter Hurley <peter@...leysoftware.com>,
Raghavendra K T <raghavendra.kt@...ux.vnet.ibm.com>,
George Spelvin <linux@...izon.com>,
"H. Peter Anvin" <hpa@...or.com>, Arnd Bergmann <arnd@...db.de>,
Aswin Chandramouleeswaran <aswin@...com>,
Scott J Norton <scott.norton@...com>,
Will Deacon <will.deacon@....com>,
"Figo.zhang" <figo1802@...il.com>
Subject: Re: [PATCH v5 2/4] MCS Lock: optimizations and extra comments
On Tue, 2013-11-19 at 11:13 -0800, Paul E. McKenney wrote:
> On Fri, Nov 08, 2013 at 11:52:05AM -0800, Tim Chen wrote:
> >
> > +/*
> > + * Releases the lock. The caller should pass in the corresponding node that
> > + * was used to acquire the lock.
> > + */
> > static void mcs_spin_unlock(struct mcs_spinlock **lock, struct mcs_spinlock *node)
> > {
> > struct mcs_spinlock *next = ACCESS_ONCE(node->next);
> > @@ -51,7 +60,7 @@ static void mcs_spin_unlock(struct mcs_spinlock **lock, struct mcs_spinlock *nod
> > /*
> > * Release the lock by setting it to NULL
> > */
> > - if (cmpxchg(lock, node, NULL) == node)
> > + if (likely(cmpxchg(lock, node, NULL) == node))
>
> Agreed here as well. Takes a narrow race to hit this.
>
> So, did your testing exercise this path? If the answer is "yes",
Paul,
I did some instrumentation and confirmed that the path in question has
been exercised. So this patch should be okay.
Tim
> and if the issues that I called out in patch #1 are resolved:
>
> Reviewed-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
>
> > return;
> > /* Wait until the next pointer is set */
> > while (!(next = ACCESS_ONCE(node->next)))
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists