Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2514367lqt; Mon, 22 Apr 2024 12:57:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsng8f6jf3CYqJJYorYXwrae2VDaDbOzx3pKJ3y6AdboTq6sCcHmmJ9LYDsUKt7ruoEn4Aq94IXz0K5INiEPpyUcCsgaz2LGFCXvTHow== X-Google-Smtp-Source: AGHT+IHl/M8W+hl1XwHRy08kwETC4tzIOWhdvKT2IwnoYW3HDSBz2mCNEDFFeQFfw7pONh4wlE8J X-Received: by 2002:a19:6b04:0:b0:51a:d433:eaa1 with SMTP id d4-20020a196b04000000b0051ad433eaa1mr6748371lfa.62.1713815848115; Mon, 22 Apr 2024 12:57:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713815848; cv=pass; d=google.com; s=arc-20160816; b=UcZNuEth3HH8enmbjvgaGWb4ypJONenw/nbISuendbvLMPT8VNkASdiuggXpr0sg0H wjLltEPIA19+3R/z7cxcXs8c+wL9tBgauMWJOOg7EmgRMZ45u87s/2xCNVzC3SbG4Yzi ulgqMSwMV87ptucvL2fs/Bkw4h7+f77EoVK+GgQUpLgIQKus0HSQY7QiTp37oJNEELS4 9HHKrt0bBlJ35nkaGly+SJB5iAJw9LdB2zPl5u73pmOhMLuOCKbzKb34PyymXrK1Nrao 1EAgHiy2iw2WkrWB5PbHeqmkAKDSk0UbzMCvdnGInxkPaQNzD1/HlJZf7tlqoEIpc5E+ AVRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=FUZCvgfKswXHZZfz34CDi4hoPT+ow62zr2X4ddEH2SI=; fh=J0IHfVn/IdGqAhurSQK1tYmlwhwyxNFKvn2PrATYVjg=; b=eQefB1qRHI7ecG/nwj/KZTK4rnQ+W5kc4IBwGSS/frNHM1ZywXjec/XQSX+ZP78hb1 zShN4iFwgrwFqt9rEkt6pYNlBDpbKyevs7KpWPB19HQeJlozGxY4scwqcjyn7Mpv5V6o I2TgvdDjqxm1B5iB2H31z7lnGhTX2sw2fZwECU49N3/YTpdtYysfaBi1pGWnGgZxvqHX 5QE+hnYscwUBLRT5jZAr05gWq/QrFeL5Ou2rlssPET5SqP11Kej5lbo6XdlHP/u6g7jL 5gQG10c6vWl3F6lmnYESQqbDQDOET4HcO4GJzzuxLtLJr+d8tR4RftSu4yC9WkbpdsES ufTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U6gi85V2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-153959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gs32-20020a1709072d2000b00a44d0209395si6734767ejc.915.2024.04.22.12.57.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:57:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=U6gi85V2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-153959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D0EF91F2158D for ; Mon, 22 Apr 2024 19:57:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1375E155386; Mon, 22 Apr 2024 19:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U6gi85V2" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA307155335 for ; Mon, 22 Apr 2024 19:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815840; cv=none; b=u/YnosZThH17bhTj0CX81xRMdUmqohFDZyu9QagJ8x4U/Gia3Nu89ytx6FjK/XrYi1fRU7TFJVcuDgMtCc4j/uonJ1r7C48GeGQKXwMw7z2PzaPdnh50Y4CDpT1M67YGQNq84I1uW/x4P9FhxL554hIOwcoehlczFpa+qe6+/Ow= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815840; c=relaxed/simple; bh=PKVHfqHJ27bSwUKMRBAbit7T+O5dPyann/zHf+lfiDA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nAwC4UcGDDRMvZOE6MlWPqQtz+dTZkdqEV2WfcI/JD4B1R7oOgtx+neOjQMLxqeqmVAG1MkmcHYtVbz0p27PRRsF4t3T4ZhjcE8R/Ul3W1CX2B5Tu2NCtrm8NOY5ShIcec3rKrL8ORmveQxFmvIGuc4xtJPXPErIAaTOQvz9v1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U6gi85V2; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2db13ca0363so76116061fa.3 for ; Mon, 22 Apr 2024 12:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713815837; x=1714420637; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FUZCvgfKswXHZZfz34CDi4hoPT+ow62zr2X4ddEH2SI=; b=U6gi85V2gFUzUL3RjzAJUK7fkx/dzkuL57KR3SlUoS2fdj+CZfofCvHlAkoeNLdn1S T3qdv+2LFHyREDNfUZI/73KXz4yIg3QNARvke5WNzslrKgF3EdlAiPZ/4OkrNqzOl9VN l+IpXEBm2weDuBVhdn/yKcjogOzQJhF7rbneZsNF0b5jA3G/30CICPAXP/Y8qM4TDvRl gXIF57H6RIThih8tseHVgWFOCosIlNycR62ShGAs+9MSVKKG0/6aXNcV+j7xhHi0OeD4 mbkzfduiSrWCIipyeLelQiLcxz0kWK6t1qUNteYN1Qxz3BpsaX6bcR3WofvTrzshsPgQ lx8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713815837; x=1714420637; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FUZCvgfKswXHZZfz34CDi4hoPT+ow62zr2X4ddEH2SI=; b=QZDv55jg6TIclCM4kTyUl6Lmcw8RLRHgigULT20T2W/b+UmZSjRJCnVLMlqCdNmfV/ cMaiOZHUZe0iMw9ItRYRtOmRgJ0868ghD7erQGmR50FOeRW9iLhA0C0z2HkDjOGZRAsi IB4xS+U7cWknsn4aMHT3pWKg8/LiCilPNUhIvak4Qx67ThyTGX4xgmWOgEQeDa0aPpWL xsWybW/8/QDyA7K4rjy+TwFa9+xJFX7j/vr3YvNv8jKCtNKzklpF7nl2eS7Co1/+mEu0 8dGOMNzmLtV0NANLC7DPHm0oZi5fAzi716J0p4PuI/K6oHnctsSpMCqfDyUfIDr7Lj0C VyKg== X-Forwarded-Encrypted: i=1; AJvYcCU8pXn6jav8sV83CL14I+3JOVya/3ygbg0EQANXnJsbf1y9s5mEXZoupPQLbS5WSQl/8xtIRNTpqYDkm7IIziunC43mahhsTgMY4gsw X-Gm-Message-State: AOJu0YwtF95J2Elo6E5Uout0iM+o6XKeoBFKkBMfg/pFFeuDfJHgpXNM 4oZgoLBXbPUo5Rxb4efURcmf/80d8oWw7ggJyTUenDcZJM8XOOlPdB7DvG5/Wy6J6fbtO+EmAt3 KXVH1hjNTe4k10IpSsY1Cb+QBXPc= X-Received: by 2002:a05:651c:1046:b0:2d8:6ca7:2165 with SMTP id x6-20020a05651c104600b002d86ca72165mr8702112ljm.46.1713815836561; Mon, 22 Apr 2024 12:57:16 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240422151752.53997-1-ubizjak@gmail.com> In-Reply-To: From: Uros Bizjak Date: Mon, 22 Apr 2024 21:57:04 +0200 Message-ID: Subject: Re: [PATCH] locking/pvqspinlock/x86: Use _Q_LOCKED_VAL in PV_UNLOCK_ASM macro To: Boqun Feng Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 22, 2024 at 9:45=E2=80=AFPM Boqun Feng w= rote: > > diff --git a/arch/x86/include/asm/qspinlock_paravirt.h b/arch/x86/inclu= de/asm/qspinlock_paravirt.h > > index 466af57b8ed6..0a985784be9b 100644 > > --- a/arch/x86/include/asm/qspinlock_paravirt.h > > +++ b/arch/x86/include/asm/qspinlock_paravirt.h > > @@ -40,7 +40,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_s= lowpath, ".spinlock.text"); > > #define PV_UNLOCK_ASM = \ > > FRAME_BEGIN \ > > "push %rdx\n\t" \ > > - "mov $0x1,%eax\n\t" \ > > + "mov $" __stringify(_Q_LOCKED_VAL) ",%eax\n\t" \ > > "xor %edx,%edx\n\t" \ > > LOCK_PREFIX "cmpxchg %dl,(%rdi)\n\t" \ > > "jne .slowpath\n\t" \ > > There is also a "cmp $0x1,%al" afterwards. Not anymore. Please note that the patch is against -tip, where we have: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=3D91= 095666125a666c8f20c2323b742c53165c0325 Thanks, Uros.