From mboxrd@z Thu Jan 1 00:00:00 1970 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 5A3C88839 for ; Wed, 2 Aug 2023 15:12:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8902AC433C7; Wed, 2 Aug 2023 15:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690989145; bh=baImNuXh2Th1Ry7XVYdyxYTkOMKeRa6JNkDyiuAbN+A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=J2rQI7BaseCeZloC2Lilf9Cj7o/A1pK5FZKVIhux1VcFovGc2TGpd6bLf5LQIGA+o DWUtTsLrScdwHCShugV0eG1+odRhy+zAFz98HWcXJIeCDB64EQU8yWmoFh9uAZltsP mkN4u81u82vrQ22nePeY8lsxQnbwrUBn/pKGG22wsrRpicN+C1Ts1rSxpkBekhuCzQ R5A3NAx3bAvE0+Zn5eMYW9LYbeuBPiQ3MZ3bSquku89JKKJFgXJ9OMj+CnnQ+f7j4v DNM3rqQM5lOP7k3PosUiGs4SBM1X+Uy1BAMUgMwIGNY/WvlX1dhYuL70riSYCz7H+W b1468KTy7gqWQ== Message-ID: <82c025b3-f3b7-cfd7-6bab-a246238129b6@kernel.org> Date: Wed, 2 Aug 2023 09:12:24 -0600 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH net 5/6] tcp_metrics: annotate data-races around tm->tcpm_net Content-Language: en-US To: Eric Dumazet , "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com, Kuniyuki Iwashima References: <20230802131500.1478140-1-edumazet@google.com> <20230802131500.1478140-6-edumazet@google.com> From: David Ahern In-Reply-To: <20230802131500.1478140-6-edumazet@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 8/2/23 7:14 AM, Eric Dumazet wrote: > tm->tcpm_net can be read or written locklessly. > > Instead of changing write_pnet() and read_pnet() and potentially > hurt performance, add the needed READ_ONCE()/WRITE_ONCE() > in tm_net() and tcpm_new(). > > Fixes: 849e8a0ca8d5 ("tcp_metrics: Add a field tcpm_net and verify it matches on lookup") > Signed-off-by: Eric Dumazet > --- > net/ipv4/tcp_metrics.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > Reviewed-by: David Ahern