Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp44679lqb; Sun, 10 Mar 2024 04:33:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1eUfTFWybmrGREaC64agL8/MPFKQy84v/oAmFdLf3bQj45GF0lOBmAVUqHeu5XDbV5Nrm23+lzj2WOLnYIAUgsgVU+JogLQr6FJBzeg== X-Google-Smtp-Source: AGHT+IG1HiX/bwhKVyBkHpBWQuPnG3wFphYun82jLbdJmE7CceFnnFo6DBUPeDSlNR0G5x5HYuAg X-Received: by 2002:a05:6a21:1a0:b0:1a1:4ec4:a23c with SMTP id le32-20020a056a2101a000b001a14ec4a23cmr1974595pzb.44.1710070398750; Sun, 10 Mar 2024 04:33:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710070398; cv=pass; d=google.com; s=arc-20160816; b=kg6w+HouOjNq9sGgbwfbqETPWac1IV7uOyCJOdQGYrr+cfYzR8FCZjVPJi30g86/lY hQgIZl6C8BDA8N8xStybmOlQ/XO8mUvLkchjkYahqitEA4PNKqe80dQdKzNHrKybGZUa peXKHBW2Lt4lMhF0i/eLMZjIF7qN8DLwKGtlZjEgdMD8j3n83sc/Rtcu6wbLOoMyDu3d t10/K0v00kOTRWz8/SRzbCo+MfrbMNQ4M5PBqrT4Dnknayv9599BIgLPA69toulQLltK YMQGAugRbmluNA27ua023iLAj6lqvxKJk/JtQTdd+MdL6IbW5g5Pjk4qHrOIxt77PKVn CZdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YWjjnQjyzOwC1iISznXSR2OaGbSmKQDVUsuZqgK1ZFY=; fh=4l+9qowW04BX7HploIwMH9ZAHo715hayd4Akd1gM/1U=; b=BCqI75fxJDxMzaa97Q2vagGEtCJHQqZuN13qsdx2TK6dB1eN3/FbZOItGoF5k/lloN 0M2aqLM7fbGXocNUiSM5uccumySgPskOctC4BwTJ0SqxuYJr1go5GQu9pkOJZKs2PIKh DeaHpAJU1utKl0IGVGd26IAei+9Wv14s5vRXOVEsco5cDGx5sLclMTMODUkR5Digjytz IyCcY+m4eyDma1yu6ymw1IJC8UogehVL7/34OsbH7/hPzZEQwqKgR9oDI2jLLlROxeQy wVo0OuH3IYR5lPbUH1Q16hh60bslGXorVeEa39StYVCPXeIH8l/uRat1ZfLVDSSNUgRC PGiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aDc3ozOb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p8-20020a170902e74800b001dcdc6e350fsi3000661plf.82.2024.03.10.04.33.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 04:33:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aDc3ozOb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6E3EC2811ED for ; Sun, 10 Mar 2024 11:33:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B1FA200D2; Sun, 10 Mar 2024 11:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aDc3ozOb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 708EF22EED; Sun, 10 Mar 2024 11:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710070391; cv=none; b=WvUJakeF77SpEVodoemJxwOC2XnDNS7E57GA8opvgF4oIOHvDR4SUHDFnI45tn8b1O5sd/KZ8IOSIeXEeznzkIxLBXbMRLWpzqReofeM92aVM5c3euSqFMLWfCr77cJIH6SXDM69fNG4mkjes/MtwFa3Clm4dYE5lVUp0uM9a6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710070391; c=relaxed/simple; bh=YWjjnQjyzOwC1iISznXSR2OaGbSmKQDVUsuZqgK1ZFY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sxO+3NYNJpVeTEbHIb39q9te/cimOTdUQafw8IsJ+ap/q+LGYUIA1HKOdSatdKgZK/K4OMPlrmX+lbq4tbBiZ4o6QNEztDwtxOHJPNQpD4Ye+lsklz0Dm3DuU2DCXUsFIZcs+83/otOPhGRT0IvjyrzWHt+MSdqiGmpBzvoqzV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aDc3ozOb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A1F6C433C7; Sun, 10 Mar 2024 11:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710070391; bh=YWjjnQjyzOwC1iISznXSR2OaGbSmKQDVUsuZqgK1ZFY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aDc3ozObFpW6fYmTmiR2OeDzowmoJhgILRGJgVSKjqAkM6s1Bc+6RP/Ky7nsCXiqX xMArkHznjMgL+XW5rFKWBDh84oXoxzOjHz2uvQLdr/R0fTWUQbWm2vUw5D38wxzhJI 4WdIGcIg0M5VL3XbjbTHWt8fORQPKvxZ7ik0/qvxty+Nj2s9WSux7ZBoBEN3oVBf8C bobiEU+cLSLrGuykwzKEe/LX1GR1VWLXGCDDb1DnCY1FKKv3zpruTIUv3IBMhiLENj rX06NAJfgMn5q+KWEJTCxzfFRn/8KLqZwce46faT2qGbB2s5Sncgq4at3r1NUQx/VI DaQSLzVTK08/Q== Date: Sun, 10 Mar 2024 13:33:06 +0200 From: Leon Romanovsky To: linke li Cc: Bernard Metzler , Jason Gunthorpe , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] RDMA/siw: Reuse value read using READ_ONCE instead of re-reading it Message-ID: <20240310113306.GF12921@unreal> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Mar 09, 2024 at 08:27:16PM +0800, linke li wrote: > In siw_orqe_start_rx, the orqe's flag in the if condition is read using > READ_ONCE, checked, and then re-read, voiding all guarantees of the > checks. Reuse the value that was read by READ_ONCE to ensure the > consistency of the flags throughout the function. Please read include/asm-generic/rwonce.h comments when READ_ONCE() is used. There is no value in caching the output of READ_ONCE(). Thanks