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 v2 0/8] nfsd, sunrpc: allow for a dynamically-sized threadpool
Date: Tue, 06 Jan 2026 13:59:42 -0500 [thread overview]
Message-ID: <20260106-nfsd-dynathread-v2-0-416e5f27b2b6@kernel.org> (raw)
This version of the patchset fixes a number of warts in the first, and
hopefully gets this closer to something mergeable.
This patchset allows 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, just like they do today.
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>
---
Changes in v2:
- svc_recv() now takes a timeout parameter. This should mean that
non-dynamic RPC services are unaffected by these changes.
- if min_threads is larger than the max, then clamp it to the max
- simplify SP_TASK_STARTING usage. Have same task set and clear it.
- rework thread starting logic (EBUSY handling)
- reorder arguments to svc_set_num_threads() and svc_set_pool_threads()
- break up larger patches
- Link to v1: https://lore.kernel.org/r/20251213-nfsd-dynathread-v1-0-de755e59cbc4@kernel.org
---
Jeff Layton (8):
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
sunrpc: split new thread creation into a separate function
sunrpc: allow svc_recv() to return -ETIMEDOUT and -EBUSY
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 | 6 +-
fs/nfs/callback.c | 10 +-
fs/nfsd/netlink.c | 5 +-
fs/nfsd/netns.h | 6 +
fs/nfsd/nfsctl.c | 50 ++++++++
fs/nfsd/nfssvc.c | 63 +++++++---
fs/nfsd/trace.h | 54 +++++++++
include/linux/sunrpc/svc.h | 13 ++-
include/linux/sunrpc/svcsock.h | 2 +-
include/uapi/linux/nfsd_netlink.h | 1 +
net/sunrpc/svc.c | 210 ++++++++++++++++++++--------------
net/sunrpc/svc_xprt.c | 44 +++++--
13 files changed, 349 insertions(+), 120 deletions(-)
---
base-commit: 83f633515af9382e7201e205112e18b995a80f70
change-id: 20251212-nfsd-dynathread-9f7a31172005
Best regards,
--
Jeff Layton <jlayton@kernel.org>
next reply other threads:[~2026-01-06 19:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 18:59 Jeff Layton [this message]
2026-01-06 18:59 ` [PATCH v2 1/8] sunrpc: split svc_set_num_threads() into two functions Jeff Layton
2026-01-06 18:59 ` [PATCH v2 2/8] sunrpc: remove special handling of NULL pool from svc_start/stop_kthreads() Jeff Layton
2026-01-06 18:59 ` [PATCH v2 3/8] sunrpc: track the max number of requested threads in a pool Jeff Layton
2026-01-06 18:59 ` [PATCH v2 4/8] sunrpc: introduce the concept of a minimum number of threads per pool Jeff Layton
2026-01-06 18:59 ` [PATCH v2 5/8] sunrpc: split new thread creation into a separate function Jeff Layton
2026-01-06 18:59 ` [PATCH v2 6/8] sunrpc: allow svc_recv() to return -ETIMEDOUT and -EBUSY Jeff Layton
2026-01-06 18:59 ` [PATCH v2 7/8] nfsd: adjust number of running nfsd threads based on activity Jeff Layton
2026-01-06 18:59 ` [PATCH v2 8/8] nfsd: add controls to set the minimum number of threads per pool Jeff Layton
2026-01-06 21:26 ` [PATCH v2 0/8] nfsd, sunrpc: allow for a dynamically-sized threadpool Chuck Lever
2026-01-06 21:53 ` Jeff Layton
2026-01-08 0:28 ` 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=20260106-nfsd-dynathread-v2-0-416e5f27b2b6@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
all inboxes | Powered by JetHome®