Skip to content

Commit

Permalink
NFSD: Batch release pages during splice read
Browse files Browse the repository at this point in the history
Large splice reads call put_page() repeatedly. put_page() is
relatively expensive to call, so replace it with the new
svc_rqst_replace_page() helper to help amortize that cost.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: NeilBrown <neilb@suse.de>
  • Loading branch information
Chuck Lever committed Aug 17, 2021
1 parent 2f0f88f commit 496d83c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,15 +849,10 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct page *page = buf->page;

if (rqstp->rq_res.page_len == 0) {
get_page(page);
put_page(*rqstp->rq_next_page);
*(rqstp->rq_next_page++) = page;
svc_rqst_replace_page(rqstp, page);
rqstp->rq_res.page_base = buf->offset;
} else if (page != pp[-1]) {
get_page(page);
if (*rqstp->rq_next_page)
put_page(*rqstp->rq_next_page);
*(rqstp->rq_next_page++) = page;
svc_rqst_replace_page(rqstp, page);
}
rqstp->rq_res.page_len += sd->len;

Expand Down

0 comments on commit 496d83c

Please sign in to comment.