From: hehuiwen <huiwen.he@linux.dev>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org, senozhatsky@chromium.org,
tom@talpey.com, chenxiaosong@chenxiaosong.com, tj@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/4] ksmbd: route WRITE requests to an unbound workqueue
Date: Thu, 29 Oct 2026 19:52:53 +0800 [thread overview]
Message-ID: <eebfec12-d0dd-433c-9332-f1e894fdcda8@linux.dev> (raw)
In-Reply-To: <CAKYAXd9Ow2SeZ1EjR7UBF3rmMn4=HKZrKajNdFU5TAnLVf=THg@mail.gmail.com>
Hi Namjae,
在 2026/10/24 12:26, Namjae Jeon 写道:
> Since this improves performance, why isn't it enabled by default?
> Also, I would like this setting to be on/off via ksmbd.conf.
I left it off by default for now, since I've noticed some
regressions.I'm testing more cases and trying to find a general
fix. If those regressions can't be avoided, a ksmbd.conf option
would be needed.
> For 4 KiB single-channel WRITEs, throughput drops from 219.55 to
> 193.01 MiB/s. Should we add a size check here to keep small WRITEs on
> the per-CPU queue?
I tried keeping small WRITEs on PERCPU and routing only larger ones
to UNBOUND. However, this did not work well for workloads with mixed
request sizes. For example, a workload mixing 8 KiB and 64 KiB WRITEs
still regressed. Small and large WRITEs share the same connection and
send lock, so a size check alone does not avoid contention.
I then changed the send path to let one worker send several completed
WRITE responses together, without waiting for more responses. This seems
to work better:
Single-channel WRITE, 16 jobs, QD32 per job, tmpfs on a 128-CPU server,
Throughput is in MiB/s.
Size PERCPU UNBOUND+batch Change
4 KiB 228.12 248.89 +6.96%
64 KiB 1797.26 2091.17 +15.34%
1 MiB 2188.42 3330.72 +53.47%
However, I found that there is still a performance regression at QD1.
1 MiB WRITE, one channel, one job:
With schedutil:
QD PERCPU UNBOUND+batch Change
1 1945.94 1021.28 -47.52%
2 2844.66 2567.18 -9.75%
4 2338.03 3547.42 +51.73%
Performance governor on all host CPUs:
QD PERCPU UNBOUND+batch Change
1 1974.35 1785.16 -9.58%
2 2904.12 3038.52 +4.63%
4 2418.45 3659.93 +51.33%
CPU frequency scaling makes the QD1 regression larger.
The main challenge seems to be balancing CPU locality and parallelism.
Keeping the work local helps QD1, while allowing it to run on another
CPU helps when receiving and processing requests in parallel. I have
not yet found a suitable policy that works well for both.
Any ideas about this?
> This walks the entire channel list and sets multichannel_seen again
> whenever an additional channel is registered. Since the flag is
> sticky, all existing channels are already marked when count > 1. Could
> we walk the list only when count == 1, marking both the existing and
> newly added connections, and update only conn->multichannel_seen when
> count > 1? This would avoid the repeated traversal and stores.
Agreed. Thanks for pointing this out.
Best regards,
Huiwen
next prev parent reply other threads:[~2026-10-29 11:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 9:25 [RFC PATCH 0/4] ksmbd: improve WRITE scheduling and TCP READ sends Huiwen He
2026-10-22 9:25 ` [RFC PATCH 1/4] workqueue: export attribute and sysfs setup helpers Huiwen He
2026-10-23 19:58 ` Tejun Heo
2026-10-22 9:25 ` [RFC PATCH 2/4] ksmbd: route WRITE requests to an unbound workqueue Huiwen He
2026-10-24 4:26 ` Namjae Jeon
2026-10-29 11:52 ` hehuiwen [this message]
2026-10-22 9:25 ` [RFC PATCH 3/4] ksmbd: complete TCP frames before reporting send success Huiwen He
2026-10-22 9:25 ` [RFC PATCH 4/4] ksmbd: send READ payloads with MSG_SPLICE_PAGES Huiwen He
2026-10-24 4:44 ` Namjae Jeon
2026-10-29 15:50 ` hehuiwen
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=eebfec12-d0dd-433c-9332-f1e894fdcda8@linux.dev \
--to=huiwen.he@linux.dev \
--cc=chenxiaosong@chenxiaosong.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=tj@kernel.org \
--cc=tom@talpey.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 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.