From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v9 1/6] MCS Lock: Barrier corrections Date: Wed, 22 Jan 2014 10:13:01 +0000 Message-ID: <20140122101301.GA1621@mudshark.cambridge.arm.com> References: <1390347353.3138.62.camel@schen9-DESK> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1390347353.3138.62.camel@schen9-DESK> Sender: owner-linux-mm@kvack.org To: Tim Chen Cc: Ingo Molnar , Andrew Morton , Thomas Gleixner , "Paul E.McKenney" , "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 , Peter Zijlstra , Rik van Riel , Peter Hurley , Raghavendra K T George Spelvin List-Id: linux-arch.vger.kernel.org On Tue, Jan 21, 2014 at 11:35:53PM +0000, Tim Chen wrote: > From: Waiman Long > > This patch corrects the way memory barriers are used in the MCS lock > with smp_load_acquire and smp_store_release fucnctions. The previous > barriers could leak critical sections if mcs lock is used by itself. > It is not a problem when mcs lock is embedded in mutex but will be an > issue when the mcs_lock is used elsewhere. > > The patch removes the incorrect barriers and put in correct > barriers with the pair of functions smp_load_acquire and smp_store_release. > > Suggested-by: Michel Lespinasse > Reviewed-by: Paul E. McKenney > Signed-off-by: Waiman Long > Signed-off-by: Jason Low > Signed-off-by: Tim Chen > --- > kernel/locking/mutex.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) Reviewed-by: Will Deacon Will -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by kanga.kvack.org (Postfix) with ESMTP id 8BCB66B0035 for ; Wed, 22 Jan 2014 05:14:53 -0500 (EST) Received: by mail-wi0-f169.google.com with SMTP id e4so6512419wiv.0 for ; Wed, 22 Jan 2014 02:14:53 -0800 (PST) Received: from cam-admin0.cambridge.arm.com (cam-admin0.cambridge.arm.com. [217.140.96.50]) by mx.google.com with ESMTP id mg5si6257454wic.40.2014.01.22.02.14.52 for ; Wed, 22 Jan 2014 02:14:52 -0800 (PST) Date: Wed, 22 Jan 2014 10:13:01 +0000 From: Will Deacon Subject: Re: [PATCH v9 1/6] MCS Lock: Barrier corrections Message-ID: <20140122101301.GA1621@mudshark.cambridge.arm.com> References: <1390347353.3138.62.camel@schen9-DESK> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1390347353.3138.62.camel@schen9-DESK> Sender: owner-linux-mm@kvack.org List-ID: To: Tim Chen Cc: Ingo Molnar , Andrew Morton , Thomas Gleixner , "Paul E.McKenney" , "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 , Peter Zijlstra , Rik van Riel , Peter Hurley , Raghavendra K T , George Spelvin , "H. Peter Anvin" , Arnd Bergmann , Aswin Chandramouleeswaran , Scott J Norton , "Figo.zhang" On Tue, Jan 21, 2014 at 11:35:53PM +0000, Tim Chen wrote: > From: Waiman Long > > This patch corrects the way memory barriers are used in the MCS lock > with smp_load_acquire and smp_store_release fucnctions. The previous > barriers could leak critical sections if mcs lock is used by itself. > It is not a problem when mcs lock is embedded in mutex but will be an > issue when the mcs_lock is used elsewhere. > > The patch removes the incorrect barriers and put in correct > barriers with the pair of functions smp_load_acquire and smp_store_release. > > Suggested-by: Michel Lespinasse > Reviewed-by: Paul E. McKenney > Signed-off-by: Waiman Long > Signed-off-by: Jason Low > Signed-off-by: Tim Chen > --- > kernel/locking/mutex.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) Reviewed-by: Will Deacon Will -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org