From: netdev-bot+sashiko@kernel.org
To: edumazet@google.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, ncardwell@google.com, kuniyu@google.com,
willemb@google.com, netdev@vger.kernel.org,
eric.dumazet@gmail.com
Subject: Re: [PATCH v2 net-next 2/9] net: add sk_set_nospace() and sk_clear_nospace()
Date: Fri, 25 Sep 2026 13:49:13 +0000 [thread overview]
Message-ID: <179034415390.2160803.16684449131851836526@kernel.org> (raw)
In-Reply-To: <20260924134729.2047213-3-edumazet@google.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The kernel-doc added for sk_clear_nospace() in net/core/sock.c
says the helper is "Called from ->sk_write_space() handlers, once send…
--
net: add sk_set_nospace() and sk_clear_nospace()
This patch adds sk_set_nospace() and sk_clear_nospace() helpers that wrap
the SOCK_NOSPACE bit operations on sk->sk_socket->flags with a NULL check.
It also converts the core networking, tcp, kcm, mptcp, smc and tls setters
and clearers to use them. It prepares for a later patch that gives TCP a
private copy of the bit and needs a single choke point.
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 2948dffcc3e1b..11a22aec7e414 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
[ ... ]
> +/**
> + * sk_clear_nospace - tell the transport no writer is waiting for space
> + * @sk: socket
> + *
> + * Called from ->sk_write_space() handlers, once send space has been
> + * made available to writers.
> + */
[Severity: Low]
This isn't a bug, but does this kernel-doc match how the helper is used?
One caller converted in this same patch doesn't follow the documented
calling context.
kcm_tx_work() in net/kcm/kcmsock.c is a work item handler
(INIT_WORK(&kcm->tx_work, kcm_tx_work)), not a ->sk_write_space() handler.
It only tests SOCK_NOSPACE and clears it without checking whether send
space is available. After that it calls ->sk_write_space():
net/kcm/kcmsock.c:kcm_tx_work() {
...
if (likely(sk->sk_socket) &&
test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
sk_clear_nospace(sk);
sk->sk_write_space(sk);
}
...
}
Other callers converted later in the series are also outside the
documented context. For example, the sunrpc svcsock code clears the bit
from a helper that checks wspace. The doc text is still the same at the
end of the series.
The commit message calls these helpers the single choke point that the
follow-up tcp_nospace patch depends on. Could the kernel-doc describe the
actual calling contexts, so nobody relies on a stricter contract when
adding ordering or locking to the helper later?
> +void sk_clear_nospace(struct sock *sk)
> +{
> + struct socket *sock = sk->sk_socket;
> +
> + if (sock)
> + clear_bit(SOCK_NOSPACE, &sock->flags);
> +}
> +EXPORT_SYMBOL(sk_clear_nospace);
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260924134729.2047213-1-edumazet%40google.com
next prev parent reply other threads:[~2026-09-25 13:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 13:47 [PATCH v2 net-next 0/9] tcp: avoid struct socket cache line miss in tcp_check_space() Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 1/9] dlm: fix send buffer backpressure handling Eric Dumazet
2026-09-25 13:49 ` netdev-bot+sashiko
2026-09-24 13:47 ` [PATCH v2 net-next 2/9] net: add sk_set_nospace() and sk_clear_nospace() Eric Dumazet
2026-09-25 13:49 ` netdev-bot+sashiko [this message]
2026-09-24 13:47 ` [PATCH v2 net-next 3/9] sunrpc: use " Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 4/9] rds: use sk_set_nospace() Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 5/9] dlm: use sk_set_nospace() and sk_clear_nospace() Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 6/9] drbd: use sk_set_nospace() Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 7/9] nvme-tcp: use sk_clear_nospace() Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 8/9] libceph: " Eric Dumazet
2026-09-24 13:47 ` [PATCH v2 net-next 9/9] tcp: add tp->tcp_nospace Eric Dumazet
2026-09-29 1:18 ` [PATCH v2 net-next 0/9] tcp: avoid struct socket cache line miss in tcp_check_space() Jakub Kicinski
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=179034415390.2160803.16684449131851836526@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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