NFSD: Batch release pages during splice read

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>
This commit is contained in:
Chuck Lever 2021-06-28 17:24:27 -04:00
parent 2f0f88f42f
commit 496d83cf0f

View File

@ -849,15 +849,10 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct page *page = buf->page; struct page *page = buf->page;
if (rqstp->rq_res.page_len == 0) { if (rqstp->rq_res.page_len == 0) {
get_page(page); svc_rqst_replace_page(rqstp, page);
put_page(*rqstp->rq_next_page);
*(rqstp->rq_next_page++) = page;
rqstp->rq_res.page_base = buf->offset; rqstp->rq_res.page_base = buf->offset;
} else if (page != pp[-1]) { } else if (page != pp[-1]) {
get_page(page); svc_rqst_replace_page(rqstp, page);
if (*rqstp->rq_next_page)
put_page(*rqstp->rq_next_page);
*(rqstp->rq_next_page++) = page;
} }
rqstp->rq_res.page_len += sd->len; rqstp->rq_res.page_len += sd->len;