From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH v5 2/8] qspinlock, x86: Enable x86-64 to use queue spinlock Date: Tue, 04 Mar 2014 10:06:07 -0500 Message-ID: <5315EBDF.90304@hp.com> References: <1393475567-4453-1-git-send-email-Waiman.Long@hp.com> <1393475567-4453-3-git-send-email-Waiman.Long@hp.com> <20140302141058.GA15629@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140302141058.GA15629@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 09:10 AM, Oleg Nesterov wrote: > 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. > Yes, the read check in queue_spin_setlock is probably redundant. Will remove that. -Longman