From: Mike Snitzer <snitzer@kernel.org>
To: Anna Schumaker <anna.schumaker@oracle.com>
Cc: Trond Myklebust <trondmy@kernel.org>, linux-nfs@vger.kernel.org
Subject: [PATCH 1/2] SUNRPC: Make rpciod and xprtiod visible in sysfs
Date: Thu, 12 Nov 2026 19:16:10 -0500 [thread overview]
Message-ID: <20261113001611.90519-2-snitzer@kernel.org> (raw)
In-Reply-To: <20261113001611.90519-1-snitzer@kernel.org>
rpciod and xprtiod are unbound workqueues. An async task's work is
queued to the affinity pod of the CPU that queues it, but an unbound
workqueue's affinity is not strict by default, so the scheduler is free
to run the worker on any CPU the workqueue allows. On a two-node NFS
client whose writers are pinned to the node local to their NIC, with
the workqueues' affinity scope set to numa, 1.5% to 2.4% of the skbs
sent on each port were still handed to the driver from the other
node's CPUs: 97% of them from rpciod running rpc_async_schedule(), the
rest from xprtiod.
Neither workqueue can be made strict today, because neither is created
with WQ_SYSFS and so neither has affinity_scope, affinity_strict or
cpumask under /sys/devices/virtual/workqueue/. Add WQ_SYSFS to both.
Nothing changes until an administrator writes those attributes.
With affinity_strict set to 1 on both, the same client sent nothing
from the other node and spent about 1.7 fewer CPUs at the same
throughput.
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
net/sunrpc/sched.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 016f16ca57799..83e2974a44d9f 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -1278,11 +1278,11 @@ static int rpciod_start(void)
/*
* Create the rpciod thread and wait for it to start.
*/
- wq = alloc_workqueue("rpciod", WQ_MEM_RECLAIM | WQ_UNBOUND, 0);
+ wq = alloc_workqueue("rpciod", WQ_MEM_RECLAIM | WQ_UNBOUND | WQ_SYSFS, 0);
if (!wq)
goto out_failed;
rpciod_workqueue = wq;
- wq = alloc_workqueue("xprtiod", WQ_UNBOUND | WQ_MEM_RECLAIM, 0);
+ wq = alloc_workqueue("xprtiod", WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
if (!wq)
goto free_rpciod;
xprtiod_workqueue = wq;
--
2.52.0
next prev parent reply other threads:[~2026-11-13 0:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 0:16 [PATCH 0/2] SUNRPC: keep the client's sends on their node, and stop copying them Mike Snitzer
2026-11-13 0:16 ` Mike Snitzer [this message]
2026-11-13 0:16 ` [PATCH 2/2] SUNRPC: Splice a request's pages into the TCP socket Mike Snitzer
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=20261113001611.90519-2-snitzer@kernel.org \
--to=snitzer@kernel.org \
--cc=anna.schumaker@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--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