From: netdev-bot+sashiko@kernel.org
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org, davem@davemloft.net,
netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg
Subject: Re: [PATCH net 11/11] ipvs: wait grace period before reusing destinations
Date: Tue, 17 Nov 2026 01:40:34 +0000 [thread overview]
Message-ID: <179487963451.3136.12564607186717303065@kernel.org> (raw)
In-Reply-To: <20261116004404.2821183-12-pablo@netfilter.org>
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 commit message describes pre-patch code that does not exist.
Pre-existing issues:
- [Low] The header comment on __ip_vs_del_service() in
net/netfilter/ipvs/ip_vs_ctl.c still says " * - We are called under…
--
ipvs: wait grace period before reusing destinations
This patch saves an RCU grace-period cookie when an IPVS destination is
moved to dest_trash or unhashed for an edit. It then waits with
cond_synchronize_rcu() before the destination's n_list, d_list or
estimator list links are reused. Trash additions are collected in a
temporary list, so one cookie is taken after all unlinks in a delete or
flush.
> When a destination is retrieved from dest_trash, ip_vs_add_dest() currently
> restarts its estimator before waiting for the grace period.
[ ... ]
> ip_vs_start_estimator() rewrites the node on its temporary list on success,
> or initializes it on failure, before the current wait. A reader can then
> follow the changed link or stop traversing the chain early.
>
> Wait immediately after retrieving the destination, before starting its
> estimator.
[Severity: Low]
Does this paragraph match the tree being patched? It reads as if an
existing grace-period wait is being moved earlier. However, the baseline
ip_vs_add_dest() has no wait between ip_vs_trash_get_dest() and
ip_vs_start_estimator():
net/netfilter/ipvs/ip_vs_ctl.c:ip_vs_add_dest() {
...
dest = ip_vs_trash_get_dest(svc, udest->af, &daddr, dport);
if (dest != NULL) {
IP_VS_DBG_BUF(3, "Get destination %s:%u from trash, "
...
ret = ip_vs_start_estimator(svc->ipvs, &dest->stats);
...
}
This patch adds cond_synchronize_rcu(dest->rcu_state) from scratch, along
with the rcu_state and need_gp bookkeeping. The phrases "currently" and
"before the current wait" seem to describe an earlier revision of the
patch, where the wait came after ip_vs_start_estimator().
Since this is Cc: stable, could the paragraph be reworded to describe the
new wait being added, so backporters don't go looking for an existing wait
to move?
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index 5868adda6ed6e..be818bf7d3806 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c
[ ... ]
> @@ -2063,7 +2123,8 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)
> * - The service must be unlinked, unlocked and not referenced!
> * - We are called under _bh lock
> */
> -static void __ip_vs_del_service(struct ip_vs_service *svc, bool cleanup)
> +static void __ip_vs_del_service(struct ip_vs_service *svc,
> + struct list_head *dest_trash, bool cleanup)
> {
> struct ip_vs_dest *dest, *nxt;
> struct ip_vs_scheduler *old_sched;
[Severity: Low]
This isn't a bug introduced by this patch, but is the "We are called
under _bh lock" line above __ip_vs_del_service() still accurate?
__ip_vs_del_service() calls ip_vs_stop_estimator() for svc->stats. It
also calls it for each dest through __ip_vs_del_dest(). Both of these can
sleep:
net/netfilter/ipvs/ip_vs_est.c:ip_vs_stop_estimator() {
...
if (ktid > 0) {
mutex_lock(&ipvs->est_mutex);
ip_vs_est_kthread_destroy(kd);
...
}
The callers are ip_vs_del_service() and ip_vs_flush(), both through
ip_vs_unlink_service(). They run in process context under service_mutex,
not under a BH lock.
Since this patch already changes the signature here, could the stale
comment line be dropped or corrected at the same time?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116004404.2821183-2-pablo%40netfilter.org
prev parent reply other threads:[~2026-11-17 1:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 0:43 [PATCH net,v2 00/11] IPVS fixes for net Pablo Neira Ayuso
2026-11-16 0:43 ` [PATCH net 01/11] ipvs: fix problems during connection deletion Pablo Neira Ayuso
2026-11-16 0:47 ` netdev-bot+sinfo
2026-11-16 0:48 ` Pablo Neira Ayuso
2026-11-16 0:43 ` [PATCH net 02/11] ipvs: avoid stack overflow from recursive connection expiration Pablo Neira Ayuso
2026-11-16 0:43 ` [PATCH net 03/11] ipvs: reject FTP control ports as data ports Pablo Neira Ayuso
2026-11-17 1:40 ` netdev-bot+sashiko
2026-11-16 0:43 ` [PATCH net 04/11] ipvs: ftp: skip conntrack templates in ip_vs_ftp_out Pablo Neira Ayuso
2026-11-16 0:43 ` [PATCH net 05/11] ipvs: update flags and seqs in backup server under lock Pablo Neira Ayuso
2026-11-17 1:40 ` netdev-bot+sashiko
2026-11-16 0:43 ` [PATCH net 06/11] ipvs: read flags and seqs in master atomically Pablo Neira Ayuso
2026-11-16 0:44 ` [PATCH net 07/11] ipvs: honor the overload state and do not enter it forever Pablo Neira Ayuso
2026-11-16 0:44 ` [PATCH net 08/11] ipvs: validate cport in received sync records Pablo Neira Ayuso
2026-11-16 0:44 ` [PATCH net 09/11] ipvs: skip cport 0 connections in ip_vs_conn_out_get() Pablo Neira Ayuso
2026-11-17 1:40 ` netdev-bot+sashiko
2026-11-16 0:44 ` [PATCH net 10/11] ipvs: do not create conns from packets with port 0 Pablo Neira Ayuso
2026-11-17 1:40 ` netdev-bot+sashiko
2026-11-16 0:44 ` [PATCH net 11/11] ipvs: wait grace period before reusing destinations Pablo Neira Ayuso
2026-11-17 1:40 ` netdev-bot+sashiko [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=179487963451.3136.12564607186717303065@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=ja@ssi.bg \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
/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