Skip to content

NFSD: Improvements for the NFSv4.2 READ_PLUS operation

Anna Schumaker linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest6 patches 2 repliesIn review

Changes in v2 from the cover letter

- Update to v5.19-rc6
- Rename xdr_stream_move_segment() -> xdr_stream_move_subsegment()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6SUNRPC: Introduce xdr_stream_move_subsegment()include/linux/sunrpc/xdr.h net/sunrpc/xdr.c+61 -00 replies
2/6SUNRPC: Introduce xdr_encode_double()include/linux/sunrpc/xdr.h net/sunrpc/xdr.c+9 -00 replies
3/6SUNRPC: Introduce xdr_buf_trim_head()include/linux/sunrpc/xdr.h net/sunrpc/xdr.c+18 -00 replies
4/6SUNRPC: Introduce xdr_buf_nth_page_address()include/linux/sunrpc/xdr.h net/sunrpc/xdr.c+19 -00 replies
5/6SUNRPC: Export xdr_buf_pagecount()net/sunrpc/xdr.c+1 -00 replies
6/6NFSD: Repeal and replace the READ_PLUS implementationfs/nfsd/nfs4xdr.c+102 -1002 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/6] NFSD: Improvements for the NFSv4.2 READ_PLUS operation

From: Anna Schumaker <[email protected]>

The main motivation for this patchset is fixing generic/091 and generic/263 with READ_PLUS. These tests appear to be failing due to files getting modified in the middle of reply encoding. Attempts to lock the file for the entire encode result in a deadlock, since llseek() and read() both need the file lock.

The solution is to read everything from disk at once, and then check if each buffer page is all zeroes or not. As a bonus, this lets us support READ_PLUS hole segments on filesystems that don't track sparse files. Additionally, this also solves the performance issues I hit when testing using btrfs on a virtual machine.

I created a wiki page with the results of my performance testing here:

    https://wiki.linux-nfs.org/wiki/index.php/Read_Plus_May_2022

These patches should probably go in before the related client changes as the client will also be changed to make use of the xdr_stream_move_subsegment() function.

Changes in v2:
- Update to v5.19-rc6
- Rename xdr_stream_move_segment() -> xdr_stream_move_subsegment()

Thoughts?
Anna

Anna Schumaker (6):
SUNRPC: Introduce xdr_stream_move_subsegment()
SUNRPC: Introduce xdr_encode_double()
SUNRPC: Introduce xdr_buf_trim_head()
SUNRPC: Introduce xdr_buf_nth_page_address()
SUNRPC: Export xdr_buf_pagecount()
NFSD: Repeal and replace the READ_PLUS implementation

 fs/nfsd/nfs4xdr.c          | 202 +++++++++++++++++++------------------
 include/linux/sunrpc/xdr.h |   6 ++
 net/sunrpc/xdr.c           | 102 +++++++++++++++++++
 3 files changed, 210 insertions(+), 100 deletions(-)
Signature · 1 line
2.37.0