diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2021-07-01 10:03:10 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2021-08-17 11:47:52 -0400 |
commit | 2f0f88f42f2eab0421ed37d7494de9124fdf0d34 (patch) | |
tree | f426289ca32413bb582d1b8ecb7d673d155ddc2f /include/linux/sunrpc | |
parent | c7e0b781b73c2e26e442ed71397cc2bc5945a732 (diff) | |
download | linux-stable-2f0f88f42f2eab0421ed37d7494de9124fdf0d34.tar.gz linux-stable-2f0f88f42f2eab0421ed37d7494de9124fdf0d34.tar.bz2 linux-stable-2f0f88f42f2eab0421ed37d7494de9124fdf0d34.zip |
SUNRPC: Add svc_rqst_replace_page() API
Replacing a page in rq_pages[] requires a get_page(), which is a
bus-locked operation, and a put_page(), which can be even more
costly.
To reduce the cost of replacing a page in rq_pages[], batch the
put_page() operations by collecting "freed" pages in a pagevec,
and then release those pages when the pagevec is full. This
pagevec is also emptied when each RPC completes.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/svc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index e91d51ea028b..ab9afbf0a0d8 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -19,6 +19,7 @@ #include <linux/sunrpc/svcauth.h> #include <linux/wait.h> #include <linux/mm.h> +#include <linux/pagevec.h> /* statistics for svc_pool structures */ struct svc_pool_stats { @@ -256,6 +257,7 @@ struct svc_rqst { struct page * *rq_next_page; /* next reply page to use */ struct page * *rq_page_end; /* one past the last page */ + struct pagevec rq_pvec; struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ struct bio_vec rq_bvec[RPCSVC_MAXPAGES]; @@ -502,6 +504,8 @@ struct svc_rqst *svc_rqst_alloc(struct svc_serv *serv, struct svc_pool *pool, int node); struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool, int node); +void svc_rqst_replace_page(struct svc_rqst *rqstp, + struct page *page); void svc_rqst_free(struct svc_rqst *); void svc_exit_thread(struct svc_rqst *); unsigned int svc_pool_map_get(void); |