Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp61030lqb; Sun, 10 Mar 2024 05:16:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuZYi7QCSONJ8Ji6YStpwy4op78Zvd9OTzDm8ebP9vbAW/zjnKLGbqPG25Z2bNOQmEA1AUcSBKwCLorDrThUJS7rw21hyzPwUoC6JiXQ== X-Google-Smtp-Source: AGHT+IH+G322oKu0bpvZwLx4x5mJPUDAY7yHNceFJDjVMWagAG26nNdj+htBZfajP5shF9BcEawD X-Received: by 2002:a2e:a98c:0:b0:2d4:3c32:814d with SMTP id x12-20020a2ea98c000000b002d43c32814dmr213811ljq.26.1710072959785; Sun, 10 Mar 2024 05:15:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710072959; cv=pass; d=google.com; s=arc-20160816; b=axhHyHJabNhayxgIJHv10kAZmeSvjd9qBLFqmiUnNIpF0KhmbO4OGofn7PrGjdf2dG kPzHXDpOOrBvoWYAUneQEtP+6disfHPkNsdkbWIJE1y0OMwvnlH/9mz9ZBtSZQyFYnyS rfNaROINLN6OyPedv1/CNBkSse3qbgnMXiB0xQB81bGfJauKDIGej/22mr2BTDfuJI6U TUDZC8QxVIQ2ilQRwzfZ+VkMyTzDrlIJM9ONZFQjWk8moa8boQhMmlmeAoq3hQhe9Csk VhYOn7UZ3O2UelMZnOIBJ4ReFpKyj5axBoERkFMyw9LgaCmEFC38U3IRlQ38L609QDeJ L7QA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:cc:to:from:message-id:dkim-signature; bh=PXdQJn47uPDxklgoRlzOz3Dfx+P5Ya2f6dtyNnSQMLU=; fh=VEgFVeNVaZe6htATt+FxTp6GQZo63iVHzcSLM5a5Y5I=; b=j2VwLxB4LxATB7fe0PTngpc2MDuoTBvJrqV6gbkB4AUwU+sYCEfHBc+dj2g0VpSPqL nioYtneBzJtwR54MUnK34QBnvZFzN2l2A/P+hgRYX5rippgIRerAckV8GAqkoiwSx3DA dTy6dY6j6rsTZB0oJoVCb1bgPeA3hrlaTyRoJ/hqhX2mWEltAkls2QopAUeRXfx3GWFm CzpovdMWUTvDnNduy4zDGxzzwwmiNEDa42TM1BtuzlLQdhpGC4Gu1dFKP3Qgb5OVBMDL Zn7Bi3bEUupbGf6S5w7cRiEcNTC3U2cDq/eYKMado2ksj0twIJfk/q7AdtfDA8zYubEF lGnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@qq.com header.s=s201512 header.b=RPAuJPvk; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-98209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.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 u7-20020a50eac7000000b00567e266a464si1541351edp.605.2024.03.10.05.15.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 05:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98209-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=@qq.com header.s=s201512 header.b=RPAuJPvk; arc=pass (i=1 spf=pass spfdomain=qq.com dkim=pass dkdomain=qq.com dmarc=pass fromdomain=qq.com); spf=pass (google.com: domain of linux-kernel+bounces-98209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=qq.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 40F7F1F213B2 for ; Sun, 10 Mar 2024 12:15:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75271219E9; Sun, 10 Mar 2024 12:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="RPAuJPvk" Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com [162.62.57.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB7E51F958; Sun, 10 Mar 2024 12:15:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.210 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710072949; cv=none; b=WknA37ZQTE6IK82cVOEtvfOvIl67/bPDaF6Ld7bwsLjJtf668tovXzTI7jI2YhVgdURUZ+BawZkWM8cvxaH7y1p3h2Q6nGWWX9FZ0zm3AZN9e0crKUKTOjJrkbXEDs7mxdX4+ilg2OxKhRWLhbVdKwY6dyntXG9CliZa0IvlzYc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710072949; c=relaxed/simple; bh=PXdQJn47uPDxklgoRlzOz3Dfx+P5Ya2f6dtyNnSQMLU=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=oQPo54P/hmDyQoOvNFTy0EGrV4l7iBEQ5p+AzOeukpT23sbzPb1y7IGMIbUo2sGsTz9BC3CbfbX2F0irJewfj8oGlwUG8QnVr169mofA7L1lSlHCKFjt50hEruNBmi1mfWP/vU616aA2F63GdRUsvyTpjosNkkyLRGB328KiFkE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=RPAuJPvk; arc=none smtp.client-ip=162.62.57.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1710072929; bh=PXdQJn47uPDxklgoRlzOz3Dfx+P5Ya2f6dtyNnSQMLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RPAuJPvkK4xobNX+xwRZndIyQh4WYzAS31qjBqDjJRbNk+0yVsGjVU3a4WOKn9ZRC X4FOirO6ekedeNQlHJkiQFU/LEpp2xub5hOmrF9Am94ALlxZBy4rUV1MIsk3s1HFtp R+78Q93fUGPHsIXOYYGbb/oGTgwQALdYGv50+MNc= Received: from localhost.localdomain ([58.213.8.163]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id 3DB94874; Sun, 10 Mar 2024 20:15:27 +0800 X-QQ-mid: xmsmtpt1710072927tapy58yra Message-ID: X-QQ-XMAILINFO: N7h1OCCDntuj8pej+XGSvtDwRXZAJYG4PotQTByHKu3P87vcDs+lwaqswZ15TZ tMfY2f1P9+z7BFOwJ3XAZH0oamwPF2pIJqfLXnStARVdsggvqf8QiPsycedMyKhiUUor1TTcOc+J CWBRfO8SbwZKGWp1FIYpZRGcro6OFNqU/iX5Zv0h3K2Nif35Wy1T0C8fYvmAnUzLVarTwUtsIeFh VkV5JYNr7TJeMjaLUCk9Lhob3Qa8iXBobT+pzMNb8Xg8K/1Ztycsl3vJ3ZME/dcSEmQS0EKWrQaO Eh+d71nFhmBI6U4ete2k2H9Apr2oLj2H/kKZ4YOBsDys0QuW4Na8u0PO3eKzJjc91dZTC0XMZ7Jc 0ZO1jFRKYWXcbmEkK+055Q4Axs6pfS1tnkQTUjERnYSg5LdRPJhWP/ju+xMMfddxpf5wEbxLEzIR x3S1aTX4WOgYzFYB25ehb49wizcA2296rPkH0lC2N5NTCFPLSg4wC/ehwfY/U4GN3kFgMBymQkfa IZAInFCK19wvsWyDDBmiOsWmi1YHSWG4YhEQRjlciqAFp9ShHie4wRf6lYXTVuAm7VXHITsZOdxo L/QZWUFds70c7VcDmS4sxUvSaEh7BG3fYSPpEI6QgYRraSdqG11hayJLI58Em1jvsVXjnCeRyMm4 +16nmPt/DDYtPDEv0FlvQel2HvjSKKhOb6zrBqiU72osobQNz+ZWXDD8ZTlD2jbHGSglm6SJ7dHH m6Hmbguu2fKucQzoPW02Q6mGfgVBWjk94tvhWSh6P0FPaY8P87Sl3QQJe19lRj9Y+j4/PbGMoX7V HIx10jzI5zUb6H16fP6aMDi0TgpW3n4coMi5f1MpuFC6PYZOz9281ICh0VmRwkj2VdMHHQPFUiGw as5O8xivMmWj9x6lSGIR9BNC8gAAVgwzco7ve2aUcQya/R9awt0X4fH8rf76PF0oU34JGsDUAWWZ H9EC9K+X0aReb8xn85yq+3wheyosx5B1voXmpGV1+1t3WFMoTethqpY+bZCepj X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= From: linke li To: leon@kernel.org Cc: bmt@zurich.ibm.com, jgg@ziepe.ca, lilinke99@qq.com, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH] RDMA/siw: Reuse value read using READ_ONCE instead of re-reading it Date: Sun, 10 Mar 2024 20:15:25 +0800 X-OQ-MSGID: <20240310121525.68804-1-lilinke99@qq.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240310113306.GF12921@unreal> References: <20240310113306.GF12921@unreal> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit I want to emphasize that if the value of orqe->flags has changed by the time of the second read, the value read will not satisfy the if condition, causing inconsistency. Given that there is already a READ_ONCE.