From: Benjamin Coddington <ben.coddington@hammerspace.com>
To: Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@kernel.org>,
NeilBrown <neil@brown.name>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2] SUNRPC: wake a thread after re-queueing transports in svc_clean_up_xprts()
Date: Mon, 5 Oct 2026 09:42:16 -0400 [thread overview]
Message-ID: <53a88892df121e5dfd0d046c2ce58df43bbf93b9.1790963561.git.bcodding@hammerspace.com> (raw)
From: Benjamin Coddington <bcodding@hammerspace.com>
svc_clean_up_xprts() takes every ready transport off the pool's queue,
deletes those belonging to the network namespace being shut down, and
puts the rest back with lwq_enqueue_batch(). No thread is woken. A
thread that tested the queue while it was drained has gone to sleep,
and the re-queued transports still carry XPT_BUSY, so the data they
receive next cannot enqueue them either. They wait until an unrelated
transport wakes a thread. lockd and the NFSv4 callback service share
one service across network namespaces and wait in svc_recv() without a
timeout, so nothing bounds that wait.
Reproduced with lockd: with NLM traffic running in the initial
network namespace, mounting and unmounting NFSv3 in a second
namespace takes lockd down there, and lock requests in the first
namespace stop being answered until something else wakes the
lockd thread.
Wake a thread after putting the transports back.
Fixes: 9a0e6accc0a8 ("SUNRPC: use lwq for sp_sockets - renamed to sp_xprts")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/cover.1782314746.git.bcodding@hammerspace.com?part=2
Signed-off-by: Benjamin Coddington <bcodding@hammerspace.com>
---
Changes in v2:
- wake a thread whenever transports are put back, not only when the
queue was empty (Chuck)
- description: drop nfsd, its service is per-net and has nothing to
put back (Chuck)
- sent with an in-body From so the author matches the Signed-off-by
v1: https://lore.kernel.org/linux-nfs/5b162e1a03d59bd0d3cc479891965834d0d4f0c8.1790948398.git.bcodding@hammerspace.com/
net/sunrpc/svc_xprt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 0de613b36fff..288d442f47c3 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1246,8 +1246,10 @@ static void svc_clean_up_xprts(struct svc_serv *serv, struct net *net)
}
}
- if (q)
+ if (q) {
lwq_enqueue_batch(q, &pool->sp_xprts);
+ svc_pool_wake_idle_thread(pool);
+ }
}
}
--
2.53.0
next reply other threads:[~2026-10-05 13:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 13:42 Benjamin Coddington [this message]
2026-10-05 15:08 ` [PATCH v2] SUNRPC: wake a thread after re-queueing transports in svc_clean_up_xprts() Chuck Lever
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=53a88892df121e5dfd0d046c2ce58df43bbf93b9.1790963561.git.bcodding@hammerspace.com \
--to=ben.coddington@hammerspace.com \
--cc=cel@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.