From: Hang Nan <2122295973@qq.com>
To: sashiko-bot@kernel.org
Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, kuniyu@google.com,
willemb@google.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, 2122295973@qq.com
Subject: Re: [PATCH net v3 2/4] net: core: take the reuseport migration reference with acquire ordering
Date: Sun, 15 Nov 2026 23:57:40 +0800 [thread overview]
Message-ID: <tencent_B3B795CD5D04DB5F115B3CED23D57EF9A40A@qq.com> (raw)
In-Reply-To: <20261114130927.91839-3-2122295973@qq.com>
Thanks, agreed - the patch is dropped in v4, and the series is now three
patches: the two mptcp token patches and the iterator one, unchanged.
One correction to the reasoning: TCP sockets are allocated from a
SLAB_TYPESAFE_BY_RCU slab too (tcp_prot.slab_flags in net/ipv4/tcp_ipv4.c),
so "not a SLAB_TYPESAFE_BY_RCU lookup" is not what separates this site
from the ones in 5b5d8f351dd9 ("net: restore refcount ordering for
lockless socket access"). What separates it is the second half of your
argument, which I agree with: the acquire only orders a validation
performed after the increment, and reuseport_migrate_sock() performs
none. It takes the reference, unlocks and returns the listener; the
callers go straight to tcp_filter() and tcp_check_req(), and the state
they actually depend on is re-checked under queue->rskq_lock in
inet_csk_reqsk_queue_add() (net/ipv4/inet_connection_sock.c:1403), which
drops the child when sk->sk_state is not TCP_LISTEN. Ordering the
increment changes nothing about what any of those paths observe, so the
change was cosmetic and I should not have included it.
I also considered adding the missing post-acquire validation instead
(re-checking sk_state or membership in the reuseport group), but that
would duplicate the check that already exists in inet_csk_reqsk_queue_add
under the queue lock, so dropping the patch seemed the honest fix.
pw-bot: cr
prev parent reply other threads:[~2026-11-15 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261114130927.91839-1-2122295973@qq.com>
2026-11-14 13:09 ` [PATCH net v3 1/4] net: mptcp: take token lookup references " Hang Nan
2026-11-14 13:09 ` [PATCH net v3 2/4] net: core: take the reuseport migration reference " Hang Nan
2026-11-14 13:09 ` [PATCH net v3 3/4] net: mptcp: reject token 0 in mptcp_token_get_sock() Hang Nan
2026-11-14 13:09 ` [PATCH net v3 4/4] net: mptcp: verify the token slot in mptcp_token_iter_next() Hang Nan
[not found] ` <20261114130927.91839-3-2122295973@qq.com>
2026-11-15 15:57 ` Hang Nan [this message]
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=tencent_B3B795CD5D04DB5F115B3CED23D57EF9A40A@qq.com \
--to=2122295973@qq.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=willemb@google.com \
/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®