Re: [PATCH 0/2] ksmbd: splice READ payloads over TCP

From: Namjae Jeon

Date: Wed Nov 25 2026 - 20:39:35 EST


On Wed, Nov 25, 2026 at 5:58 PM hehuiwen <huiwen.he@xxxxxxxxx> wrote:
>
> Hi Namjae,
Hi Huiwen,
>
> On a single TCP connection, pure per-CPU makes the RX thread and workers
> fight for the same core.
>
> Pure unbound fixes that, but causes other problems: parallel workers
> still contend on srv_mutex and send small replies one by one, cross-CPU
> execution hurts locality, and under schedutil spreading the load can
> drop workers onto lower-frequency CPUs (on the 64 KiB READ send path we
> saw ~1.97 GHz with per-CPU vs. ~0.9 GHz with unbound). For serial 1-job
> QD=1 writes, there is no overlap to benefit from either.
>
> For example(Throughput:MiB/s):
>
> Workload jobs/QD PERCPU UNBOUND Change
> ----------------- ------- ------- ------- -------
> 1ch, 64 KiB READ 16/32 2051.38 1387.34 -32.37%
> 1ch, 4 KiB WRITE 16/32 215.82 182.71 -15.34%
> 1ch, 1 MiB WRITE 1/1 1948.84 1109.46 -43.07%
> 4ch, 64 KiB WRITE 16/32 2788.42 2497.57 -10.43%
> 4ch, 1 MiB WRITE 16/32 3482.73 3291.34 -5.50%
>
> So I tried sending only WRITE requests to an unbound workqueue, batching
> completed WRITE replies, and only using the unbound queue when WRITEs
> actually overlap (keeping serial WRITEs per-CPU). So far, across
> low/high QD, small/large blocks, READ/WRITE/mixed, and multichannel, it
> performs better than per-CPU without introducing the unbound regressions.
>
> However, given how complex the overlap-detection logic is, I'm not
> confident enough in its reliability yet and want to see if there's a
> simpler way. Right now I'm thinking of keeping a few switchable modes in
> ksmbd and picking the one that works best in most cases as the default.
> What do you think?
Okay, understood. Could you share the patch for your approach, along
with the benchmark setup and results? I’ll review the implementation,
especially the WRITE-overlap detection, to check its correctness and
see whether the logic can be simplified.
Thanks.