From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753241AbbCaRuo (ORCPT ); Tue, 31 Mar 2015 13:50:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44340 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752906AbbCaRuk (ORCPT ); Tue, 31 Mar 2015 13:50:40 -0400 Date: Tue, 31 Mar 2015 19:50:50 +0200 From: Oleg Nesterov To: Will Deacon Cc: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra Subject: Re: [RESEND PATCH] documentation: memory-barriers: fix smp_mb__before_spinlock() semantics Message-ID: <20150331175050.GA14778@redhat.com> References: <1427791181-21952-1-git-send-email-will.deacon@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427791181-21952-1-git-send-email-will.deacon@arm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/31, Will Deacon wrote: > > Could somebody pick this up please? I guess I could route it via the arm64 > tree with an Ack, but I'd rather it went through Paul or -tip. I think this would be the best route ;) > --- a/Documentation/memory-barriers.txt > +++ b/Documentation/memory-barriers.txt > @@ -1768,10 +1768,9 @@ for each construct. These operations all imply certain barriers: > > Memory operations issued before the ACQUIRE may be completed after > the ACQUIRE operation has completed. An smp_mb__before_spinlock(), > - combined with a following ACQUIRE, orders prior loads against > - subsequent loads and stores and also orders prior stores against > - subsequent stores. Note that this is weaker than smp_mb()! The > - smp_mb__before_spinlock() primitive is free on many architectures. > + combined with a following ACQUIRE, orders prior stores against > + subsequent loads and stores. Note that this is weaker than smp_mb()! > + The smp_mb__before_spinlock() primitive is free on many architectures. I agree, this description was always wrong. But perhaps you can also update the comment above smp_mb__before_spinlock? It only documents the STORE - LOAD serialization, and this was on purpose. But people started to use this helper assuming that it can also serialize the STOREs. Perhaps the changelog could also mention this fact, this is why we need to update this comment and fix memory-barriers.txt. Oleg.