From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH v5 2/8] qspinlock, x86: Enable x86-64 to use queue spinlock Date: Sun, 2 Mar 2014 15:10:58 +0100 Message-ID: <20140302141058.GA15629@redhat.com> References: <1393475567-4453-1-git-send-email-Waiman.Long@hp.com> <1393475567-4453-3-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-3-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 On 02/26, Waiman Long wrote: > > +#define _ARCH_SUPPORTS_ATOMIC_8_16_BITS_OPS > + > +/* > + * x86-64 specific queue spinlock union structure > + */ > +union arch_qspinlock { > + struct qspinlock slock; > + u8 lock; /* Lock bit */ > +}; And this enables the optimized version of queue_spin_setlock(). But why does it check ACCESS_ONCE(qlock->lock) == 0 ? This is called right after queue_get_lock_qcode() returns 0, this locked should be likely unlocked. Oleg.