Skip to content

Commit 496d83c

Browse files
committed
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 <[email protected]> Reviewed-by: NeilBrown <[email protected]>
1 parent 2f0f88f commit 496d83c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/nfsd/vfs.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -849,15 +849,10 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
849849
struct page *page = buf->page;
850850

851851
if (rqstp->rq_res.page_len == 0) {
852-
get_page(page);
853-
put_page(*rqstp->rq_next_page);
854-
*(rqstp->rq_next_page++) = page;
852+
svc_rqst_replace_page(rqstp, page);
855853
rqstp->rq_res.page_base = buf->offset;
856854
} else if (page != pp[-1]) {
857-
get_page(page);
858-
if (*rqstp->rq_next_page)
859-
put_page(*rqstp->rq_next_page);
860-
*(rqstp->rq_next_page++) = page;
855+
svc_rqst_replace_page(rqstp, page);
861856
}
862857
rqstp->rq_res.page_len += sd->len;
863858

0 commit comments

Comments
 (0)