Linux NFS development
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Move rq_vec[] and rq_bvec[] out of svc_rqst
@ 2025-04-16 15:28 cel
  2025-04-16 15:28 ` [RFC PATCH 1/2] sunrpc: Replace the rq_bvec array with dynamically-allocated memory cel
  2025-04-16 15:28 ` [RFC PATCH 2/2] sunrpc: Replace the rq_vec " cel
  0 siblings, 2 replies; 6+ messages in thread
From: cel @ 2025-04-16 15:28 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>

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-16 18:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 15:28 [RFC PATCH 0/2] Move rq_vec[] and rq_bvec[] out of svc_rqst cel
2025-04-16 15:28 ` [RFC PATCH 1/2] sunrpc: Replace the rq_bvec array with dynamically-allocated memory cel
2025-04-16 18:42   ` Jeff Layton
2025-04-16 18:45     ` Chuck Lever
2025-04-16 18:55       ` Jeff Layton
2025-04-16 15:28 ` [RFC PATCH 2/2] sunrpc: Replace the rq_vec " cel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox