Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

SUNRPC: Be even lazier about releasing pages

A single RPC transaction that touches only a couple of pages means
rq_pvec will not be even close to full in svc_xpt_release(). This is
a common case.

Instead, just leave the pages in rq_pvec until it is completely
full. This improves the efficiency of the batch release mechanism
on workloads that involve small RPC messages.

The rq_pvec is also fully emptied just before thread exit.

Reviewed-by: Calum Mackay <calum.mackay@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+3 -3
+3
net/sunrpc/svc.c
··· 649 649 if (!rqstp) 650 650 return rqstp; 651 651 652 + pagevec_init(&rqstp->rq_pvec); 653 + 652 654 __set_bit(RQ_BUSY, &rqstp->rq_flags); 653 655 rqstp->rq_server = serv; 654 656 rqstp->rq_pool = pool; ··· 896 894 void 897 895 svc_rqst_free(struct svc_rqst *rqstp) 898 896 { 897 + pagevec_release(&rqstp->rq_pvec); 899 898 svc_release_buffer(rqstp); 900 899 if (rqstp->rq_scratch_page) 901 900 put_page(rqstp->rq_scratch_page);
-3
net/sunrpc/svc_xprt.c
··· 541 541 kfree(rqstp->rq_deferred); 542 542 rqstp->rq_deferred = NULL; 543 543 544 - pagevec_release(&rqstp->rq_pvec); 545 544 svc_rqst_release_pages(rqstp); 546 545 rqstp->rq_res.page_len = 0; 547 546 rqstp->rq_res.page_base = 0; ··· 665 666 struct svc_serv *serv = rqstp->rq_server; 666 667 struct xdr_buf *arg = &rqstp->rq_arg; 667 668 unsigned long pages, filled, ret; 668 - 669 - pagevec_init(&rqstp->rq_pvec); 670 669 671 670 pages = (serv->sv_max_mesg + 2 * PAGE_SIZE) >> PAGE_SHIFT; 672 671 if (pages > RPCSVC_MAXPAGES) {