From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH v5 1/8] qspinlock: Introducing a 4-byte queue spinlock implementation Date: Tue, 04 Mar 2014 09:58:14 -0500 Message-ID: <5315EA06.2090305@hp.com> References: <1393475567-4453-1-git-send-email-Waiman.Long@hp.com> <1393475567-4453-2-git-send-email-Waiman.Long@hp.com> <20140302133140.GA13830@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140302133140.GA13830@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Oleg Nesterov 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" , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Scott J Norton , Steven Rostedt , Chris Wright , Alok Kataria , Aswin Chandramouleeswaran , Chegu Vinod List-Id: linux-arch.vger.kernel.org On 03/02/2014 08:31 AM, Oleg Nesterov wrote: > 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. > I am just following the current logic in the mcs_spin_unlock function. It is probably true that we don't need the release semantic in this particular case. -Longman