From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEE3832FA2E for ; Mon, 20 Apr 2026 15:38:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776699513; cv=none; b=b08oCWuGcVKpSwW81zAMF1AaAgrscST9y6LwDo0VHq52D2QXhQG9pg965rGxBBf1oTehfIKLBjb+1Ht5s2oy3OxrDUmZbEcxGoLJO+53h7z96UzZiUSZCgA+wYaTfrQHa29SSxfl6nKNtRB6dfpkq52Ma2NpuSRMuKsgxrAqMsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776699513; c=relaxed/simple; bh=1YPmlSibFAs93TrPIvpjlN+QQ8aYFSYODNs2PRv9JqQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rFXwqB9mrPoaGpIiLvzgagDRlX9cA2edMP1ohczH6k3VJMzVxOdKYBSDQ+gg1VVOYcXIpxQDpxSiD+rDEarL3Yr4fSND2tli6XiPaNBjTSfhkpm8bX1QVReLvFokjvxOfb2NqmqACZjpDc+7Ih9x28iGVCys4ehDqquMhFbeqws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hFTSG+O+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hFTSG+O+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF9CEC19425; Mon, 20 Apr 2026 15:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776699513; bh=1YPmlSibFAs93TrPIvpjlN+QQ8aYFSYODNs2PRv9JqQ=; h=From:To:Cc:Subject:Date:From; b=hFTSG+O+y0yKagcgwzGonKMibIswdL5dSasDdLLT21ApYJ6q5yd8KmEoqlrLvNlUH CH1YXMwSdz3J+pcZGdp8sdAX3+a03wEnvNvM5zb2P7pOTdlMYx8HLRL5YR7019FpWw JBg9yRALXkzSX9sy225qyZOta4M/j4eItnldKHOK2MJQdF8dcYyW8/AL0lGS5D3o9f g0Zd1dkfJM90wU77vTjnw1ju5RZFZM2YnrTPKchTFJIrgP57GJLb1mw/RY2kvj+xBM 9CEGLUcNMgiFFt/RmyHASiMmdwLiC061wyNS+hhSPl1hPdcxJOezJLFhEy9m7br9i2 xUbAD73wb/nsw== From: Chuck Lever To: NeilBrown , Jeff Layton , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: , Chuck Lever Subject: [PATCH] NFSD: Increase the default max_block_size to 4MB Date: Mon, 20 Apr 2026 11:38:30 -0400 Message-ID: <20260420153830.463215-1-cel@kernel.org> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Commit 8a81f16de64f ("NFSD: Add a "default" block size") introduced NFSSVC_DEFBLKSIZE at 1MB, well below the 4MB NFSSVC_MAXBLKSIZE ceiling, with the stated intent that a later change would raise the default. Raising the default reduces per-RPC overhead on fast networks by amortizing header processing and scheduling costs across larger payloads. The halving loop in nfsd_get_default_max_blksize() constrains the returned value to 1/4096 of available RAM, so the new 4MB default takes effect only on systems with at least 16GB of RAM. Smaller machines continue to receive the same computed value as before. Administrators can still override the computed value through /proc/fs/nfsd/max_block_size. On systems where the new default takes effect, svc_sock_setbufsize() sizes each service socket's send and receive buffers as nreqs * max_mesg * 2. Quadrupling max_mesg therefore quadruples the per-socket buffer reservation at a fixed thread count, which operators tuning large thread pools should account for. Note well: Your NFS client implementation must support large read and write size settings to benefit from this change. Signed-off-by: Chuck Lever --- fs/nfsd/nfsd.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index a01d70953358..daa63c1b161c 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -45,11 +45,10 @@ bool nfsd_support_version(int vers); /* * Default and maximum payload size (NFS READ or WRITE), in bytes. - * The default is historical, and the maximum is an implementation - * limit. + * The maximum is an implementation limit. */ enum { - NFSSVC_DEFBLKSIZE = 1 * 1024 * 1024, + NFSSVC_DEFBLKSIZE = 4 * 1024 * 1024, NFSSVC_MAXBLKSIZE = RPCSVC_MAXPAYLOAD, }; -- 2.53.0