From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH v5 1/8] qspinlock: Introducing a 4-byte queue spinlock implementation Date: Sun, 2 Mar 2014 14:31:40 +0100 Message-ID: <20140302133140.GA13830@redhat.com> References: <1393475567-4453-1-git-send-email-Waiman.Long@hp.com> <1393475567-4453-2-git-send-email-Waiman.Long@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1393475567-4453-2-git-send-email-Waiman.Long@hp.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Waiman Long Cc: Jeremy Fitzhardinge , Raghavendra K T , kvm@vger.kernel.org, Peter Zijlstra , virtualization@lists.linux-foundation.org, Andi Kleen , "H. Peter Anvin" , Michel Lespinasse , Thomas Gleixner , linux-arch@vger.kernel.org, Gleb Natapov , x86@kernel.org, Ingo Molnar , xen-devel@lists.xenproject.org, "Paul E. McKenney" , Arnd Bergmann , Scott J Norton , Rusty Russell , Steven Rostedt , Chris Wright , Alok Kataria , Aswin Chandramouleeswaran , Chegu Vinod , Boris Ostrovsky , linux-kernel List-Id: linux-arch.vger.kernel.org Forgot to ask... On 02/26, Waiman Long wrote: > > +notify_next: > + /* > + * Wait, if needed, until the next one in queue set up the next field > + */ > + while (!(next = ACCESS_ONCE(node->next))) > + arch_mutex_cpu_relax(); > + /* > + * The next one in queue is now at the head > + */ > + smp_store_release(&next->wait, false); Do we really need smp_store_release()? It seems that we can rely on the control dependency here. And afaics there is no need to serialise this store with other changes in *lock, plus they all have mb's anyway. Oleg.