From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH RFC 0/6] nfsd: allow for a dynamically-sized threadpool
Date: Sat, 13 Dec 2025 07:39:12 +0900 [thread overview]
Message-ID: <20251213-nfsd-dynathread-v1-0-de755e59cbc4@kernel.org> (raw)
This patchset changes nfsd to dynamically size its threadpool as
needed. The main user-visible change is the addition of new controls
that allow the admin to set a minimum number of threads.
When the minimum is set to a non-zero value, the traditional "threads"
setting is interpreted as a maximum number of threads instead of a
static count. The server will start the minimum number of threads, and
then ramp up the thread count as needed. When the server is idle, it
will gradually ramp down the thread count.
This control scheme should allow us to sanely switch between kernels
that do and do not support dynamic threading. In the case where dynamic
threading is not supported, the user will just get the static maximum
number of threads.
The series is based on a set of draft patches by Neil. There are a
number of changes from his work:
1/ his original series was based around a new setting that defined a
maximum number of threads. This one instead adds a control to define a
minimum number of threads.
2/ if the thread's wait doesn't hit the timeout, then svc_recv() will
not return -ETIMEDOUT and the thread will stay running. Timeouts only
happens if a thread is wakes up without finding work to do.
3/ the printks in his original patches have been changed to tracepoints
So far this is only lightly tested, but it seems to work well. I
still need to do some benchmarking to see whether this affects
performance, so I'm posting this as an RFC for now.
Does this approach look sane to everyone?
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Jeff Layton (6):
sunrpc: split svc_set_num_threads() into two functions
sunrpc: remove special handling of NULL pool from svc_start/stop_kthreads()
sunrpc: track the max number of requested threads in a pool
sunrpc: introduce the concept of a minimum number of threads per pool
nfsd: adjust number of running nfsd threads based on activity
nfsd: add controls to set the minimum number of threads per pool
Documentation/netlink/specs/nfsd.yaml | 5 +
fs/lockd/svc.c | 4 +-
fs/nfs/callback.c | 8 +-
fs/nfsd/netlink.c | 5 +-
fs/nfsd/netns.h | 6 ++
fs/nfsd/nfsctl.c | 50 ++++++++++
fs/nfsd/nfssvc.c | 56 ++++++++---
fs/nfsd/trace.h | 54 ++++++++++
include/linux/sunrpc/svc.h | 11 +-
include/linux/sunrpc/svcsock.h | 2 +-
include/uapi/linux/nfsd_netlink.h | 1 +
net/sunrpc/svc.c | 182 +++++++++++++++++++---------------
net/sunrpc/svc_xprt.c | 45 +++++++--
13 files changed, 315 insertions(+), 114 deletions(-)
---
base-commit: b6cf9ca7e7555f7f079bb062e3cd99a501e0d611
change-id: 20251212-nfsd-dynathread-9f7a31172005
Best regards,
--
Jeff Layton <jlayton@kernel.org>
next reply other threads:[~2025-12-12 22:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 22:39 Jeff Layton [this message]
2025-12-12 22:39 ` [PATCH RFC 1/6] sunrpc: split svc_set_num_threads() into two functions Jeff Layton
2025-12-13 19:29 ` Chuck Lever
2025-12-13 21:55 ` Jeff Layton
2025-12-12 22:39 ` [PATCH RFC 2/6] sunrpc: remove special handling of NULL pool from svc_start/stop_kthreads() Jeff Layton
2025-12-12 22:39 ` [PATCH RFC 3/6] sunrpc: track the max number of requested threads in a pool Jeff Layton
2025-12-12 22:39 ` [PATCH RFC 4/6] sunrpc: introduce the concept of a minimum number of threads per pool Jeff Layton
2025-12-13 20:19 ` Chuck Lever
2025-12-13 21:38 ` Jeff Layton
2025-12-12 22:39 ` [PATCH RFC 5/6] nfsd: adjust number of running nfsd threads based on activity Jeff Layton
2025-12-13 20:54 ` Chuck Lever
2025-12-13 21:43 ` Jeff Layton
2025-12-12 22:39 ` [PATCH RFC 6/6] nfsd: add controls to set the minimum number of threads per pool Jeff Layton
2025-12-13 21:10 ` Chuck Lever
2025-12-13 21:47 ` Jeff Layton
2025-12-13 19:34 ` [PATCH RFC 0/6] nfsd: allow for a dynamically-sized threadpool Chuck Lever
2025-12-13 21:35 ` Jeff Layton
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=20251213-nfsd-dynathread-v1-0-de755e59cbc4@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
--cc=trondmy@kernel.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;
as well as URLs for NNTP newsgroup(s).