From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock Date: Thu, 31 Oct 2013 12:11:21 +0100 Message-ID: <52723AD9.4040902@redhat.com> References: <20131030190929.GA7153@redhat.com> <20131030201552.GP4126@linux.vnet.ibm.com> <20131030232605.GA28823@redhat.com> <20131031045629.GT4126@linux.vnet.ibm.com> <20131031064743.GB20205@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Paul E. McKenney" , "Michael S. Tsirkin" , linux-kernel , kvm@vger.kernel.org To: Gleb Natapov Return-path: In-Reply-To: <20131031064743.GB20205@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Il 31/10/2013 07:47, Gleb Natapov ha scritto: > This looks dubious to me. All other smp_mb__after_* variants are there > because some atomic operations have different memory barrier semantics on > different arches, It doesn't have to be arches; unlock APIs typically have release semantics only, but SRCU is stronger. > but srcu_read_unlock() have the same semantics on all > arches, so smp_mb__after_srcu_read_unlock() becomes > smp_mb__after_a_function_that_happens_to_have_mb_now_but_may_not_have_in_the_feature(). > How likely it is that smp_mb() will disappear from srcu_read_unlock() > (if was added for a reason I guess)? May be we should change documentation > to say that srcu_read_unlock() is a memory barrier which will reflect > the reality. That would be different from all other unlock APIs. Paolo