* [PATCH] NFSD: Increase the default max_block_size to 4MB
@ 2026-04-20 15:38 Chuck Lever
2026-04-20 17:12 ` Jeff Layton
2026-04-20 21:25 ` Roland Mainz
0 siblings, 2 replies; 3+ messages in thread
From: Chuck Lever @ 2026-04-20 15:38 UTC (permalink / raw)
To: NeilBrown, Jeff Layton, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, Chuck Lever
From: Chuck Lever <chuck.lever@oracle.com>
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 <chuck.lever@oracle.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] NFSD: Increase the default max_block_size to 4MB
2026-04-20 15:38 [PATCH] NFSD: Increase the default max_block_size to 4MB Chuck Lever
@ 2026-04-20 17:12 ` Jeff Layton
2026-04-20 21:25 ` Roland Mainz
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2026-04-20 17:12 UTC (permalink / raw)
To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, Chuck Lever
On Mon, 2026-04-20 at 11:38 -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> 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 <chuck.lever@oracle.com>
> ---
> 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,
> };
>
Makes sense, particularly with dynamic threading.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] NFSD: Increase the default max_block_size to 4MB
2026-04-20 15:38 [PATCH] NFSD: Increase the default max_block_size to 4MB Chuck Lever
2026-04-20 17:12 ` Jeff Layton
@ 2026-04-20 21:25 ` Roland Mainz
1 sibling, 0 replies; 3+ messages in thread
From: Roland Mainz @ 2026-04-20 21:25 UTC (permalink / raw)
To: linux-nfs; +Cc: Chuck Lever
On Mon, Apr 20, 2026 at 5:38 PM Chuck Lever <cel@kernel.org> wrote:
>
> From: Chuck Lever <chuck.lever@oracle.com>
>
> 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 <chuck.lever@oracle.com>
> ---
> 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,
> };
Works with ms-nfs41-client.
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz@nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-20 21:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 15:38 [PATCH] NFSD: Increase the default max_block_size to 4MB Chuck Lever
2026-04-20 17:12 ` Jeff Layton
2026-04-20 21:25 ` Roland Mainz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox