From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.218 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107884; b=d+Ob/snhE38ITeLglVoMTrPcdzttdGKJh10Jarle3QdNxuFA+VfLMnD2muaa50xIoqwq z9ietJmMyn+YyRNXs300Utvp7/klIsndUEUxSehSghWrIKgv6y6jr+muKEGPdfV0HRKV8 6bkZhkPSrEnd/uAamI8735ltqLsVhKtEATbBWUAzusnFL7d7NH4xe9e158Xm1c+Cpzt/4 rEjKTrLjXRonvDhMPZ1+the5mT60cj2E5kjW9nVZ+ZLFoRliK330uK7C+ig21JP56PPMI A064DHCUe/gx/ihMemHu522HEKThxk8h6woxB9yr4nX0DCqd4g1LU1m9V0yUhc3r8oQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107884; 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=y0rswW4puC0aN6YhBwmu0UZrO/+mSdRNZsM98/D5Amg=; b=SyJDVX/qcRVCXe8+nOj80pZ0vIN5P18jVxBzqaPJlpNy9qhS02D5QUxA2r+SaqWkM6tk wfomnzDcdDMtVyThHFMg4RRxTnt+wwYLZ/A/Rz6XBfjCqTN3hcAOsTxeCjXMOxdgKv8rh daYxwn/oznLG7+p7YYMp4dFEOTZ9NlBSQaqtUYjdshWqYt+ahcU44cEW0ZJ5nUJo5R+vK wVjbpCEVwwS5ba9iBq5CFDCEHf/+FMRdZEiswkzdFYzikEpRS9s9fS5iRcvN6Q9bvnJGf iigEd5N3yhrptHPF+p5MnVutm3lqqR4u24LBTnGnchzvOFIXx0efjuUTjY6cu3VeIlA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chenxiaosong.com; spf=pass smtp.mailfrom=chenxiaosong.com; dkim=pass header.d=chenxiaosong.com header.i=@chenxiaosong.com header.a=rsa-sha256 header.s=key1 header.b=u5TDxTO5; arc=none smtp.remote-ip=95.215.58.218 Received: from mta1.migadu.com (out-218.mta1.migadu.com [95.215.58.218]) (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 B90C1606A68D for ; Tue, 1 Dec 2026 06:51:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B90C1606A68D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chenxiaosong.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chenxiaosong.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=chenxiaosong.com header.i=@chenxiaosong.com header.a=rsa-sha256 header.s=key1 header.b=u5TDxTO5 X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=G7iezcUc1hswrGeTgRbmWbAbRlruGgqxbDID04FkNNY=; c=simple/simple; d=chenxiaosong.com; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796107878; v=1; x=1796712678; b=u5TDxTO5IbnEte1x6u4/YmmD1/Cfw6GamqlGNDFC6tw7qhgm7uCrVMjSGJ+/rclBXyISLFFk Be6C5VB0CL4f5qWN/NfQrSqHc5aPBLcMOHABBs8ApasdomXooNtucT+ZzWwiDPlw/iZ5qzJgvVP EiCFCsFLYCE5TqYTLq1SmHgbpJWfm+2+FeSteMJolydF0Xu6QaUXAXYvMnZwEokBQ5QwkoI34G3 g3+pbI/Gs1jSaH8ADWOBENsslbJJrr3TlM8PCBmnhQYuSfwa6Tq5f7ZmYo/yJxTs0JeAPeqDRRG SzWFiAwxQpHjStHYpGnToP/SAOdcOUMxJC4bELo5k9gyA== X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 5df1f15520aef736; Tue, 01 Dec 2026 06:51:18 +0000 X-Mizu-Trace-ID: 5df1f15520aef736 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Tue, 1 Dec 2026 14:51:07 +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/4] ksmbd: allow request dispatch on an unbound workqueue To: Huiwen He , linkinjeon@kernel.org Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, senozhatsky@chromium.org, tom@talpey.com, tj@kernel.org, jiangshanlai@gmail.com, stefan.chulski@broadcom.com References: <20261201032749.2224354-1-huiwen.he@linux.dev> Content-Language: en-US From: ChenXiaoSong In-Reply-To: <20261201032749.2224354-1-huiwen.he@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: ChenXiaoSong On 12/1/26 11:27, Huiwen He wrote: > From: Huiwen He > > 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 -- ChenXiaoSong Chinese Homepage: https://chenxiaosong.com English Homepage: https://chenxiaosong.com/en