Skip to content

RFC Move rq_vec[] and rq_bvec[] out of svc_rqst

[email protected] linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sunrpc: Replace the rq_bvec array with dynamically-allocated memoryinclude/linux/sunrpc/svc.h net/sunrpc/svc.c net/sunrpc/svcsock.c+10 -53 replies
2/2sunrpc: Replace the rq_vec array with dynamically-allocated memoryfs/nfsd/nfs4proc.c fs/nfsd/vfs.c include/linux/sunrpc/svc.h +1 more+10 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] Move rq_vec[] and rq_bvec[] out of svc_rqst

From: Chuck Lever <[email protected]>

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(-)
Signature · 1 line
2.49.0