Skip to content

Commit 647a2a6

Browse files
committed
SUNRPC: Convert svc_xprt_release() to the release_pages() API
Instead of invoking put_page() one-at-a-time, pass the "response" portion of rq_pages directly to release_pages() to reduce the number of times each nfsd thread invokes a page allocator API. Since svc_xprt_release() is not invoked while a client is waiting for an RPC Reply, this is not expected to directly impact mean request latencies on a lightly or moderately loaded server. However as workload intensity increases, I expect somewhat better scalability: the same number of server threads should be able to handle more work. Reviewed-by: Calum Mackay <calum.mackay@oracle.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent b20cb39 commit 647a2a6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

net/sunrpc/svc.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,13 +878,12 @@ EXPORT_SYMBOL_GPL(svc_rqst_replace_page);
878878
*/
879879
void svc_rqst_release_pages(struct svc_rqst *rqstp)
880880
{
881-
while (rqstp->rq_next_page != rqstp->rq_respages) {
882-
struct page **pp = --rqstp->rq_next_page;
881+
int i, count = rqstp->rq_next_page - rqstp->rq_respages;
883882

884-
if (*pp) {
885-
put_page(*pp);
886-
*pp = NULL;
887-
}
883+
if (count) {
884+
release_pages(rqstp->rq_respages, count);
885+
for (i = 0; i < count; i++)
886+
rqstp->rq_respages[i] = NULL;
888887
}
889888
}
890889

0 commit comments

Comments
 (0)