mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] ksmbd: allow request dispatch on an unbound workqueue
@ 2026-12-01  3:27 Huiwen He
  2026-12-01  3:27 ` [PATCH 1/4] ksmbd: keep server in RESETTING until defaults are restored Huiwen He
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Huiwen He @ 2026-12-01  3:27 UTC (permalink / raw)
  To: linkinjeon
  Cc: linux-cifs, linux-kernel, senozhatsky, tom, chenxiaosong, tj,
	jiangshanlai, stefan.chulski

From: Huiwen He <hehuiwen@kylinos.cn>

ksmbd currently dispatches incoming requests to a per-CPU workqueue.
Pipelined writes on a single connection can leave the receive thread
and workers competing for the same CPU. An unbound workqueue lets
workers use other CPUs, but the cost of cross-CPU handoffs can outweigh
the gain from parallelism.

Patch 1 fixes a race that can let ksmbd accept a new startup request
before reset finishes restoring the server defaults.

Patch 2 handles startup failures in the current control work item, so
recovery does not depend on allocating another one.

Patch 3 exports the helpers needed to set CPU scope before sysfs
registration.

Patch 4 lets ksmbd.mountd select the workqueue for all incoming SMB
requests at server startup. With the companion ksmbd-tools patch,
administrators can set "server request workqueue = unbound" in
ksmbd.conf. The default is "percpu".

Single-channel fio throughput in MiB/s on tmpfs (schedutil, 128 CPUs,
16 jobs, iodepth 32, mixed 50/50 read/write). Both unbound scopes are
non-strict (shard = cache_shard); delta compares unbound (cpu) with
per-CPU.

  Size     I/O     per-CPU     unbound     unbound       delta
                               (shard)      (cpu)
  ------------------------------------------------------------
  4 KiB    READ        294         182         243      -17.3%
  4 KiB    WRITE       251         178         177      -29.5%
  4 KiB    MIXED       263         146         199      -24.3%

  64 KiB   READ       2583        1791        2171      -15.9%
  64 KiB   WRITE      1640        1882        2013      +22.8%
  64 KiB   MIXED      2194        1503        1834      -16.4%

  256 KiB  READ       3119        3012        3127       +0.2%
  256 KiB  WRITE      2183        3155        3233      +48.1%
  256 KiB  MIXED      2906        3213        3239      +11.4%

  1 MiB    READ       3398        3259        3413       +0.5%
  1 MiB    WRITE      2047        3032        3091      +51.0%
  1 MiB    MIXED      2859        3367        3416      +19.5%

The October RFC explored using an unbound workqueue for selected
WRITE requests [1].

As a follow-up, I am looking into an adaptive mode that weighs the
benefits of parallelism against the costs of spreading work across
CPUs. The goal is to outperform both fixed modes on most workloads and
become the default.

[1] https://lore.kernel.org/r/20261022092514.2590010-1-huiwen.he@linux.dev

Huiwen He (4):
  ksmbd: keep server in RESETTING until defaults are restored
  ksmbd: reset the server directly on startup failure
  workqueue: export attribute and sysfs setup helpers
  ksmbd: add request workqueue mode startup option

 fs/smb/server/ksmbd_netlink.h |  8 ++++-
 fs/smb/server/ksmbd_work.c    | 64 +++++++++++++++++++++++++++++++++--
 fs/smb/server/ksmbd_work.h    |  3 +-
 fs/smb/server/server.c        | 27 +++++++++------
 fs/smb/server/server.h        |  4 ++-
 fs/smb/server/transport_ipc.c |  5 +++
 kernel/workqueue.c            |  4 +++
 7 files changed, 100 insertions(+), 15 deletions(-)


base-commit: 87ff512becd45a08c44fd47a9f03e607af9ef6bd

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-01  6:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01  3:27 [PATCH 0/4] ksmbd: allow request dispatch on an unbound workqueue Huiwen He
2026-12-01  3:27 ` [PATCH 1/4] ksmbd: keep server in RESETTING until defaults are restored Huiwen He
2026-12-01  3:27 ` [PATCH 2/4] ksmbd: reset the server directly on startup failure Huiwen He
2026-12-01  3:27 ` [PATCH 3/4] workqueue: export attribute and sysfs setup helpers Huiwen He
2026-12-01  6:47   ` ChenXiaoSong
2026-12-01  3:27 ` [PATCH 4/4] ksmbd: add request workqueue mode startup option Huiwen He
2026-12-01  6:51 ` [PATCH 0/4] ksmbd: allow request dispatch on an unbound workqueue ChenXiaoSong

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®