From: Chuck Lever <chuck.lever@xxxxxxxxxx> In order to make RPCSVC_MAXPAYLOAD larger (or variable in size), we need to do something clever with the payload arrays embedded in struct svc_rqst. Here's one way of dealing with two of them. My preference is to keep these arrays allocated all the time because allocating them on demand increases the risk of a memory allocation failure during a large I/O. This is a quick-and-dirty approach that might be replaced once NFSD is converted to use large folios. The downside of this design choice is that it pins a few pages per NFSD thread (and that's the current situation already). But note that because RPCSVC_MAXPAGES is 259, each array is just over a page in size, making the allocation waste quite a bit of memory beyond the end of the array due to power-of-2 allocator round up. This gets worse as the MAXPAGES value is doubled or quadrupled. I plan to look at rq_pages[] next. Chuck Lever (2): sunrpc: Replace the rq_bvec array with dynamically-allocated memory sunrpc: Replace the rq_vec array with dynamically-allocated memory fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/vfs.c | 2 +- include/linux/sunrpc/svc.h | 4 ++-- net/sunrpc/svc.c | 14 +++++++++++++- net/sunrpc/svcsock.c | 7 +++---- 5 files changed, 20 insertions(+), 9 deletions(-) -- 2.49.0