From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.193 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795597114; b=kW/vk+Y75Q3Of6ACeK9C2utUQdgYjLkY/Vp7RC0EjXo8Vh7ikMrOWbMb4qz4Er8zxXqj esN8vXVCj5tyZfJxfkhvaFxxyR41mEBwYWJFh3SKZyfWMYbXrTKAmvQwxNBeoHmF7MU15 SJp8HFuhs4U+IZzYQbWwFE9tqUYxLUs8D2eDjPE7i1SgCOlh8r4h//gsqelmEDqKgHr9W SGg//l+edheGg+a15XoxLIchTXkVV7uUAjNi6ecTcMJVvfLhqiiDX5tlOI7vla/jSpPkg hnf7ijcumiGi5HjOmycwFwUi9REZqsSZZhcO0Tc/twhP+Orh7UU7EiTW0F+dn4AnB8g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795597114; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=bc7nuZMJjZ66RAXa3XZY4QgSdXa+1/f74i4Vd6ipG/k=; b=u9b2/T3G4wJPZIxqt5i01aBbCI+M7E942E1Mj0ZDS1scnb4WY0OQ3KpSDdLZGShLnZUV 0mQ6UDomlinnFocPeH9j1TQWS4ZzXwMjm+uytCZ22fhXobZK7SvGKL138Mzt8ILAszbG5 jpH9n5qHvT1rEPJOKvU1/dTYtvIM0otKD99wQlW2jfrM4NGYtCBD8WZTOuZwdrzXblZlZ KeU3OpV+4vU7koQHe6gfauGSx5hNn+KPTW9xmguFCqN7loX1xIMgiJI0np3Aj3Rv6eYkq Ao4qFCwlD3kNJl31VOInN6j5diDa0jxrcUNQyNyEFF1m5eUAc+7lRaODKXmOTf/kxnw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=QUsAl538; arc=none smtp.remote-ip=95.215.58.193 Received: from mta1.migadu.com (out-193.mta1.migadu.com [95.215.58.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63D6F606A331 for ; Wed, 25 Nov 2026 08:58:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 63D6F606A331 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=QUsAl538 X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=23kp1HdGjIM/G8/9zl1qp3aH6HKsh3N0XvtatOV79V4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795597111; v=1; x=1796201911; b=QUsAl538dWTfDlpiXoNuSpX6tiLDrai6hCFVGrpE4QOjfibJ61qzB8XJaT1ZmKPgq5YSUdVI 9hPhiQDwxHaBaxBPx8ALiyFLBgTsoCtMzELBJs3LTCxXzLOXxVYy2ASuDPZpWrYzA3lk5drnvUI G5M2lTqtmNpBSZjoMLLNvCC0= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 2c9cec84fe8096d0; Wed, 25 Nov 2026 08:58:31 +0000 X-Mizu-Trace-ID: 2c9cec84fe8096d0 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Wed, 25 Nov 2026 16:58:23 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] ksmbd: splice READ payloads over TCP To: Namjae Jeon Cc: linux-cifs@vger.kernel.org, Sergey Senozhatsky , Tom Talpey , ChenXiaoSong , linux-kernel@vger.kernel.org References: <20261124132554.1185817-1-huiwen.he@linux.dev> Content-Language: en-US From: hehuiwen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Namjae, 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? Thanks, Huiwen 在 2026/11/25 15:29, Namjae Jeon 写道: > On Tue, Nov 24, 2026 at 10:30 PM Huiwen He wrote: >> >> From: Huiwen He >> >> ksmbd reads file data into a private response buffer. TCP then copies >> the payload into an skb. If the reply must be queued, ksmbd also >> copies the unsent bytes into a queue buffer. >> >> This series uses MSG_SPLICE_PAGES to avoid those TCP copies for plain, >> standalone READs: patch 1 splices the initial TCP send from private >> pages and a header page fragment, and patch 2 retains references to >> unsent payload folios on the send queue so the send worker can splice >> them as well. >> >> Summary of fio sequential read results (16 jobs, QD32 per job, SMB3.1.1 >> tmpfs; each column is relative to the preceding commit): >> >> Channels I/O Throughput change Host Gcycles/GiB change >> patch 1 patch 2 patch 1 patch 2 >> 1 4 KiB -0.3% -0.9% +1.8% -1.1% >> 1 64 KiB +28.4% +0.9% -31.5% -5.9% >> 1 256 KiB +60.8% +5.3% -40.5% -22.5% >> 1 1 MiB +51.5% +9.2% -33.1% -32.2% >> 4 4 KiB +0.2% +0.2% +0.9% +0.2% >> 4 64 KiB +3.9% +2.6% -6.9% +0.8% >> 4 256 KiB +12.1% -0.4% -43.0% -0.8% >> 4 1 MiB +17.6% +7.1% -39.5% -34.7% >> >> Huiwen He (2): >> ksmbd: send READ payloads with MSG_SPLICE_PAGES >> ksmbd: retain unsent READ pages on the TCP send queue > I don't see any patch using unbound workqueues in this series. Will > you send it to the list later ? or need to check it more? > > Thanks.