Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: achender@kernel.org
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	pabeni@redhat.com, edumazet@google.com, kuba@kernel.org,
	horms@kernel.org, nicoyip.dev@gmail.com
Subject: Re: [PATCH net-next v2 8/9] net/rds: drop rds_conn_count in favor of t_conn_count
Date: Wed, 16 Sep 2026 04:36:50 +0000	[thread overview]
Message-ID: <178953341064.22033.4344829262087873675@kernel.org> (raw)
In-Reply-To: <20260912035027.27447-9-achender@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 0 · Low: 1

- [Low] Changelog inaccuracy in "net/rds: drop rds_conn_count in favor of
  t_conn_count": the commit message states that removing the…

--

net/rds: drop rds_conn_count in favor of t_conn_count

This removes the global rds_conn_count now that each transport tracks its
own connections in t_conn_count, and seeds the per-path workqueue names
from t_conn_count instead.  The rds_conn_lock round-trip that existed only
to decrement rds_conn_count is dropped from rds_conn_destroy_fini().

> Removing the counter also removes the rds_conn_lock round-trip that
> rds_conn_destroy_fini() took solely to decrement it, leaving the
> free path lock-free.

[Severity: Low]
Is the free path really lock-free after this change?

rds_conn_destroy_fini() still calls rds_conn_path_free() for every path,
and that ends up in destroy_workqueue():

net/rds/connection.c:rds_conn_path_free() {
	if (cp->cp_wq != rds_wq) {
		destroy_workqueue(cp->cp_wq);
		cp->cp_wq = NULL;
	}
	...
}

destroy_workqueue() drains the queue and takes wq_pool_mutex, so it can
sleep.  The tail of rds_conn_destroy_fini() also takes the wait-queue
spinlock via wake_up_all(&rds_conn_freed_waitq).  What this patch removes
is the last rds_conn_lock acquisition, not all locking.

The concern with the current wording is that a later reader or a
backporter could take "lock-free" to mean the final rds_conn_put() may be
dropped from atomic, IRQ or softirq context, which this path cannot
tolerate because destroy_workqueue() may sleep.

The last patch of this series, "net/rds: hold a connection reference from
struct rds_incoming", states the opposite property:

  "The final rds_conn_put() runs the free path, which destroys the
   per-path workqueues and therefore may sleep, so the last reference has
   to be dropped from process context"

Would something like "removes the last rds_conn_lock round-trip from the
free path" be more accurate here?

> diff --git a/net/rds/connection.c b/net/rds/connection.c
> index 1ec141d6faa38..11813f93961d1 100644
> --- a/net/rds/connection.c
> +++ b/net/rds/connection.c

[ ... ]

> @@ -656,7 +654,6 @@ static void rds_conn_destroy_fini(struct kref *kref)
>  						   c_refcount);
>  	int npaths = (conn->c_trans->t_mp_capable ? RDS_MPATH_WORKERS : 1);
>  	struct rds_transport *trans = conn->c_trans;
> -	unsigned long flags;
>  	int i;
>  
>  	for (i = 0; i < npaths; i++)
> @@ -665,10 +662,6 @@ static void rds_conn_destroy_fini(struct kref *kref)
>  	kfree(conn->c_path);
>  	kmem_cache_free(rds_conn_slab, conn);
>  
> -	spin_lock_irqsave(&rds_conn_lock, flags);
> -	rds_conn_count--;
> -	spin_unlock_irqrestore(&rds_conn_lock, flags);
> -
>  	/* only after everything the transport module owns has been
>  	 * freed above may its unload proceed
>  	 */

The code change itself looks fine; only the changelog wording seems to
overstate the result.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260912035027.27447-1-achender%40kernel.org

  reply	other threads:[~2026-09-16  4:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12  3:50 [PATCH net-next v2 0/9] net/rds: make connection lifetime reference-counted Allison Henderson
2026-09-12  3:50 ` [PATCH net-next v2 1/9] net/rds: guard every work-requeueing site with rds_destroy_pending() Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 2/9] net/rds: make rds_destroy_pending() cover single-connection destroy Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 3/9] net/rds: split connection destroy into quiesce and kref-governed free Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 4/9] net/rds: wait for connections to be freed on transport unload Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 5/9] net/rds: unlink transport nodes before a possibly deferred connection free Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 6/9] net/rds: hold connection references in lookup, sockets and c_passive Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 7/9] net/rds: pin the connection across RDMA-CM event handling Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko
2026-09-12  3:50 ` [PATCH net-next v2 8/9] net/rds: drop rds_conn_count in favor of t_conn_count Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko [this message]
2026-09-12  3:50 ` [PATCH net-next v2 9/9] net/rds: hold a connection reference from struct rds_incoming Allison Henderson
2026-09-16  4:36   ` netdev-bot+sashiko

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=178953341064.22033.4344829262087873675@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=achender@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicoyip.dev@gmail.com \
    --cc=pabeni@redhat.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