From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbbINSk3 (ORCPT ); Mon, 14 Sep 2015 14:40:29 -0400 Received: from g2t4623.austin.hp.com ([15.73.212.78]:34625 "EHLO g2t4623.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbbINSk0 (ORCPT ); Mon, 14 Sep 2015 14:40:26 -0400 Message-ID: <55F71489.2010605@hpe.com> Date: Mon, 14 Sep 2015 14:40:09 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: Peter Zijlstra CC: Davidlohr Bueso , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Subject: Re: [PATCH v6 1/6] locking/qspinlock: relaxes cmpxchg & xchg ops in native code References: <1441996658-62854-1-git-send-email-Waiman.Long@hpe.com> <1441996658-62854-2-git-send-email-Waiman.Long@hpe.com> <20150911222744.GC19736@linux-q0g1.site> <20150914120619.GQ18489@twins.programming.kicks-ass.net> In-Reply-To: <20150914120619.GQ18489@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/14/2015 08:06 AM, Peter Zijlstra wrote: > On Fri, Sep 11, 2015 at 03:27:44PM -0700, Davidlohr Bueso wrote: >> On Fri, 11 Sep 2015, Waiman Long wrote: >> >>> @@ -46,7 +46,7 @@ static inline bool virt_queued_spin_lock(struct qspinlock *lock) >>> if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) >>> return false; >>> >>> - while (atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL) != 0) >>> + while (atomic_cmpxchg_acquire(&lock->val, 0, _Q_LOCKED_VAL) != 0) >>> cpu_relax(); >> This code has changed with Peter's recent ccas fix. And the whole virt_queued_spin_lock() >> thing will now be under pv configs. So this doesn't apply to native code anymore, so it >> looks like it should be dropped altogether. > Yeah, it also doesn't make sense, this ix x86 arch code, x86 cannot do > cmpxchg_acquire. Then again, I suppose we could argue its of > documentation value.. Yes, it is to be consistent with the change in asm_generic qspinlock.h. We can certainly skip that. Cheers, Longman