mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: quanyeyang <quanyeyang@proton.me>
Cc: Quanye Yang via B4 Relay
	<devnull+quanyeyang.proton.me@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Neal Cardwell <ncardwell@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	Geliang Tang <geliang@kernel.org>,
	Mat Martineau <martineau@kernel.org>,
	Jiayuan Chen <jiayuan.chen@linux.dev>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 1/2] tcp: annotate lockless access to sk->sk_err
Date: Fri, 18 Sep 2026 13:27:47 +0100	[thread overview]
Message-ID: <20260918132747.6ac8beeb@pumpkin> (raw)
In-Reply-To: <zEvCcu9s6PbTRajtbCvCik2zCOJsXozLWWvYsLfl6AV4IJLyXmS63i5nuaCmqk_5DsRajMO3IjRtFpOSpmRY55ByjpBJ8NmtwDk-kSpr9bM=@proton.me>

On Fri, 18 Sep 2026 10:33:04 +0000
quanyeyang <quanyeyang@proton.me> wrote:

> On Friday, September 18th, 2026 at AM 2:51, David Laight <david.laight.linux@gmail.com> wrote:
> 
> > Don't they need annotating with data_race() ?  
> 
> I think READ_ONCE() is the intended marker here.

If the race is with locked accesses I think you need both.

David

> 
> These loads are part of the I/O control flow (stop send/recv/splice),
> not diagnostic or heuristic reads. data_race() would silence KCSAN
> but would not restrict compiler optimizations, so the load could still
> be torn, fused or reissued. READ_ONCE() is a single-copy atomic load
> and pairs with the existing WRITE_ONCE()/xchg() updates of sk_err,
> same as tcp_poll() after e13ec3da05d1.
> 
> sock_error() uses data_race() only on the fast-path "is it zero?"
> check, which is then validated by xchg(). That pattern does not
> apply to these peeks.
> 
> Quanye
> 


  reply	other threads:[~2026-09-18 12:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 13:41 [PATCH net-next v4 0/2] " Quanye Yang via B4 Relay
2026-09-17 13:41 ` [PATCH net-next v4 1/2] " Quanye Yang via B4 Relay
2026-09-18  9:51   ` David Laight
2026-09-18 10:33     ` quanyeyang
2026-09-18 12:27       ` David Laight [this message]
2026-09-18 14:49         ` quanyeyang
2026-09-17 13:41 ` [PATCH net-next v4 2/2] mptcp: " Quanye Yang via B4 Relay
2026-09-18 11:28   ` Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260918132747.6ac8beeb@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devnull+quanyeyang.proton.me@kernel.org \
    --cc=edumazet@google.com \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quanyeyang@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®